#
# Makefile for IDL source code To be used on UNIX!
#

DIRS = wind \
	general

# get *.pro files from SCCS directories, as they might not be checked out
# .. and add idlUtil, which doesn't have an SCCS directory
SOURCE:sh = find . -name s.\*.pro -print | sed 's~SCCS/s\.~~'

# ********************************************************************
#  Standard targets

TARGETS = all install clean 

# --------------------------------------------------------------------
#  Recursively descend into subdirectories of the current one
#  and run make in each one.  

$(TARGETS) :: FORCED
	@- DIRS="$(DIRS)" ; \
	for i in $$DIRS ; do \
	    if [ -d $$i ] ; then \
		echo --------------------------------------------- ; \
		echo '###' Starting make $@ in $$i ; \
		(cd $$i ; $(MAKE) $@ ; ); \
		echo '###' Finished make $@ in $$i ; \
		echo --------------------------------------------- ; \
	    fi \
	done ; \
	$(MAKE) local$(@)

FORCED:

ALLTARGETS: help crib.demo idl_3dp.init README.html tarfile

help:  help.html help_3dp.html 3dp_tutorial.html

help.html: $(SOURCE)
	$(RM) help.html
	/disks/apollo/export/idl_6.1/bin/idl -32 makehelp

tarfile: $(SOURCE)
	tar cfFFh SCCS/allIDLcode.tar *
	tar cfFFh SCCS/general.tar general
	tar cfFFh SCCS/personal.tar personal
	cp SCCS/*.tar ../idl
	cd ../idl ;pwd ; tar xvf ../idlSCCS/SCCS/allIDLcode.tar ; cd ../idlSCCS

localall:  ALLTARGETS 

localinstall: localall

localclean:
	sccs clean
	$(RM) make_doc
	$(RM) *% *~
	$(RM) core
