CC = cc -std=c99
CFLAGS = -Wall -g $(INCLUDES)

INCLUDES =
#
# N.b. Utils must come first:
#
DIRS = Utils Metadata

.PHONY : all
all :
	@for d in $(DIRS); do \
	    echo "cd $$d; $(MAKE)"; \
	    (cd $$d; $(MAKE)); \
	done
#
# `Our' .h files
#
HFILES = psArray.h psDlist.h psHash.h psLogMsg.h psMemory.h psMisc.h psTrace.h

check :
	../Utilities/bin/check-namespace `find Utils Metadata .. -name *.[ao] -print` \
		`find . -name \*.h -print` \
		`echo $(HFILES) | perl -pe 's:(^| ): ../PSLib/include/:g;'`
#
clean :
	$(RM) $(PROGS) *.o *.a *.log *.dvi *.aux *.toc *.log *.out *~ core TAGS
	@for d in $(DIRS); do \
	    echo "cd $$d; $(MAKE) clean"; \
	    (cd $$d; $(MAKE) clean); \
	done
empty : clean
	@for d in $(DIRS); do \
	    echo "cd $$d; $(MAKE) empty"; \
	    (cd $$d; $(MAKE) empty); \
	done
