# These variables are configurable.
#---------------------------------------#
ifdef XEMP
DIRS := lib x
endif
ifdef TCEMP
DIRS := lib termc
endif
#---------------------------------------#

.PHONY: all depend clean dependall cleanall checkinall editinall checkoutall editoutall

include make/UtilMakefile

# Productions:
#	all: Make everything
#	depend: Modify the makefiles to reflect the local setup.
#	dependall: Make depend in all the directories.
#	cleanall: Make clean in all the directories.
#	archall: (If the ARCH env var is set).  mkdir $ARCH in all subdirs.

all: dirs
	
ifdef SRCDIR
depend:
	mkmf -df make/GenMakefile SRCDIR=$(SRCDIR)
else
depend:
	mkmf -df make/GenMakefile SRCDIR=`pwd`
endif
clean:

dependall:
	$(MAKE) COMMAND=depend recursive

cleanall:
	$(MAKE) COMMAND=clean recursive

checkinall:
        $(MAKE) COMMAND=checkin recursive

editinall:
        $(MAKE) COMMAND=editin recursive

checkoutall:
        $(MAKE) COMMAND=checkout recursive

editoutall:
        $(MAKE) COMMAND=editout recursive

installall:
	$(MAKE) COMMAND=install recursive

install:

ifdef ARCH
eviscerate:
	find . -name $(ARCH) -a -type d -exec rm -rf \{\} \;

archall:
	$(MAKE) COMMAND=arch recursive
endif
