# This makefile is a convenience during testing, allowing to check a
# default make target, gives a list of more useful targets
default:
	@echo "The following are the generally useful targets:"
	@echo " "
	@echo "make dir.ldd	(does cd dir; make -f dir.mkf clean, inst)"
	@echo "make clean	(rm *.ldd)"
	@echo "make all	(xpp.ldd daz.ldd, list db bin dirs, test report)"
	@echo "make rebuild	(clean, all)"
#
# We depend on a script to set up shell variables such as PPTARGETDIR
# that this make file and the package make files need. This should be
# based on the file dev_env in the top-level of the OpenProofPower source.
# (which is used by default, but can be overridden by setting PPENVSCRIPT).
#
ENVSCRIPT=$(shell echo $${PPENVSCRIPT:-../dev_env})

all: xpp.ldd daz.ldd list testreport

clean:
	-rm *ldd

rebuild: clean all


pptex.ldd:
	. $(ENVSCRIPT); PKG=pptex; cd $$PKG; \
		for t in clean inst test; do make -f $$PKG.mkf $$t; done
	touch pptex.ldd

dev.ldd:	pptex.ldd
	. $(ENVSCRIPT); PKG=dev; cd $$PKG; \
		for t in clean inst test; do make -f $$PKG.mkf $$t; done
	touch dev.ldd

xpp.ldd:	pptex.ldd
	. $(ENVSCRIPT); PKG=xpp; cd $$PKG; \
		for t in clean inst; do make -f $$PKG.mkf $$t; done
	touch xpp.ldd

hol.ldd:	dev.ldd
	. $(ENVSCRIPT); PKG=hol; cd $$PKG; \
		for t in clean inst test; do make -f $$PKG.mkf $$t; done
	touch hol.ldd

zed.ldd:	hol.ldd
	. $(ENVSCRIPT); PKG=zed; cd $$PKG; \
		for t in clean inst test; do make -f $$PKG.mkf $$t; done
	touch zed.ldd

daz.ldd:	zed.ldd
	. $(ENVSCRIPT); PKG=daz; cd $$PKG; \
		for t in clean inst test; do make -f $$PKG.mkf $$t; done
	touch daz.ldd

list:
	. $(ENVSCRIPT); \
	ls -lR $$PPTARGETDIR/bin $$PPTARGETDIR/db

testreport: daz.ldd
	for d in dev hol zed daz; do cd $$d; pwd; mtreport *.ttd; cd ..; done
