#
# Customize the local preferences in Makefile.rules
#
include ./Makefile.rules

#
# Sub directories for recursive make.  
#
MAKEABLE= devices AF
MAKEABLE_MACHDEP = 

#
# Local targets for installation.
#
INTSTALLTARGETS=

none:

Help::
	@echo ""
	@echo "Using ./Makefile.rules.example as a template,"
	@echo "create and customize ./Makefile.rules according to your local site"
	@echo "preferences (also see the ./AF/RELNOTES.ps for more"
	@echo "detail on the uses of the macros in ./Makefile.rules.)  "
	@echo ""
	@echo "You also need to define a similar set of macros for"
	@echo "the ./AF sub-tree by customizing ./AF/config/site.def."
	@echo ""
	@echo "To build and install the complete AF kit,"
	@echo "perform these steps.  You may need to be root for"
	@echo "the installation steps."
	@echo ""
	@echo "As,	  root			unprivileged user"
	@echo "          ----			-----------------"
	@echo "1)   make dirs"
	@echo "2)				make clean"
	@echo "3)				(cd devices; make all)"
	@echo "4)   (cd devices; make install)"
	@echo "5)				(cd AF; make World)"
	@echo "6)   (cd AF; make install)"
	@echo "7)   make install.man"
	@echo ""
	@echo ""


World::
	@echo "This will only succeed if you have read/write access"
	@echo "to all target directories defined in ./Makefile.rules"
	@echo "and ./AF/config/site.def !!!"
	@echo ""
	make dirs
	@echo --- "Making clean in all"; \
	(make clean)
	@echo --- "Making all in devices"; \
	(cd devices; $(MAKE) all)
	@echo --- "Making install in devices"; \
	(cd devices; $(MAKE) install)
	@echo --- "Making World in AF"; \
	(cd AF; $(MAKE) $@)
	@echo --- "Making install in AF"; \
	(cd AF; $(MAKE) install)

DIRLIST	=	$(MANDIR) $(USRLIBDIR) $(USRLIBDIR)/tcl $(INCDIR) \
		$(LODDIR) $(DOCDIR) $(SCRIPTDIR) $(BINDIR)


dirs:
	@for i in $(DIRLIST); \
	do \
	    if test -d $$i; \
	    then 	echo $$i 'exists' ;\
	    else	mkdir -p $$i; \
	    fi; \
	done
	@for i in 1 2 3 4 5 6 7 8; \
	do \
	    if test -d $(MANDIR)/man$$i; \
	    then 	echo $(MANDIR)/man$$i 'exists' ;\
	    else	mkdir -p $(MANDIR)/man$$i; \
	    fi; \
	done

all clean install install.man::
	@for i in $(MAKEABLE); \
	do \
	  echo --- $$i; \
	  (cd $$i; $(MAKE) $@ ); \
	done
#	@for i in $(MAKEABLE_MACHDEP); \
#	do \
#	  echo --- $$i.`/bin/machine`; \
#	  (cd $$i.`/bin/machine`; $(MAKE) $@ ); \
#	done

installdsp::
	echo --- "Making all in third"; \
	(cd third; $(MAKE) all)
	echo --- "Making install in third"; \
	(cd third; $(MAKE) install)

all::

install::

install.man::

clean::
	rm -f *.CKP *.ln *.BAK *.bak *.o core errs ,* *~ .emacs_* tags TAGS make.log MakeOut
	
