# $HeadURL$ $LastChangedRevision$ BASE_DIR = .. include $(BASE_DIR)/bldcfg/prologue.mk include $(BASE_DIR)/bldcfg/settings.mk include $(BASE_DIR)/bldcfg/epilogue.mk BIN_FILES = adespp adeinst aderel adeconf aderoot adegmt adetest compile: $(BIN_FILES) # This alternative block for 'compile' might prove useful if the above produces some # cryptic errors. #compile: # $(MAKE) adespp # $(MAKE) adeinst # $(MAKE) aderel # $(MAKE) adeconf # $(MAKE) aderoot # $(MAKE) adegmt # $(MAKE) adetest clean: rm -f $(BIN_FILES) /tmp/adespp_stage* ADESPP_ORDERED_SRCS = adespp.spp $(UTILS_PL_SPP) $(GEP_PL_SPP) $(PATHS_SPP) adespp: $(ADESPP_ORDERED_SRCS) @# @# @# @# Make the known-to-not-have-good-paths @# should-just-be-enough-to-make-minimal-adespp @# adespp @# @#echo "Making mininal adespp ..." sed -e "s%SPPSYM_PERL_CMD%$(PERL_CMD)%g" \ $(ADESPP_ORDERED_SRCS) > /tmp/adespp_stage0 chmod a+rx /tmp/adespp_stage0 @# @# @# @# Use the known-to-not-have-good-paths @# should-just-be-enough-to-make-minimal-adespp @# adespp to make what should be a good one. @# @#echo "Using mininal adespp to make adespp ..." $(PERL_CMD) /tmp/adespp_stage0 \ -D SPPSYM_PATHS_MK=$(PATHS_MK) \ -D SPPSYM_PATHS_SPP=$(PATHS_SPP) \ $(ADESPP_FLAGS) \ adespp.spp /tmp/adespp_stage1 @# @# @# @# Now check that the good one by using it to @# make another one. Acceptable differences @# between then are in the 'Generated by' @# header only ('!' used to force exit code to @# reflect this. @# @#echo "Using adespp to make a test adespp ..." /tmp/adespp_stage1 \ -D SPPSYM_PATHS_SPP=$(PATHS_SPP) \ -D SPPSYM_PATHS_MK=$(PATHS_MK) \ $(ADESPP_FLAGS) \ adespp.spp /tmp/adespp_stage2 diff /tmp/adespp_stage1 /tmp/adespp_stage2 | \ egrep -v '^[<>].*(masquerading as adespp_stage[01]|Generated on date:)' | { ! egrep '^[<>]'; } @#echo "Copying final adespp to target ..." cp /tmp/adespp_stage2 adespp @# @# @# @# Clean up @# @#echo "Removing intermediate targets ..." rm /tmp/adespp_stage0 /tmp/adespp_stage1 \ /tmp/adespp_stage2 adegmt: adegmt.spp $(UTILS_SH_SPP) adespp \ $(GEP_SH_SPP) $(PATHS_MK) $(PATHS_SPP) $(PERL_CMD) ./adespp \ -D SPPSYM_PATHS_SPP=$(PATHS_SPP) \ -D SPPSYM_PATHS_MK=$(PATHS_MK) \ $(ADESPP_FLAGS) $< aderoot: aderoot.spp $(UTILS_SH_SPP) adespp \ $(GEP_SH_SPP) $(PATHS_MK) $(PATHS_SPP) $(PERL_CMD) ./adespp \ -D SPPSYM_PATHS_SPP=$(PATHS_SPP) \ -D SPPSYM_PATHS_MK=$(PATHS_MK) \ $(ADESPP_FLAGS) $< adetest: adetest.spp $(UTILS_SH_SPP) adespp \ $(GEP_SH_SPP) $(PATHS_MK) $(PATHS_SPP) $(PERL_CMD) ./adespp \ -D SPPSYM_PATHS_SPP=$(PATHS_SPP) \ -D SPPSYM_PATHS_MK=$(PATHS_MK) \ $(ADESPP_FLAGS) $< adeinst: adeinst.spp $(UTILS_SH_SPP) adespp \ $(GEP_SH_SPP) $(PATHS_MK) $(PATHS_SPP) $(PERL_CMD) ./adespp \ -D SPPSYM_PATHS_SPP=$(PATHS_SPP) \ -D SPPSYM_PATHS_MK=$(PATHS_MK) \ $(ADESPP_FLAGS) $< aderel: aderel.spp $(UTILS_PL_SPP) adespp \ $(GEP_PL_SPP) $(PATHS_MK) $(PATHS_SPP) $(PERL_CMD) ./adespp \ -D SPPSYM_PATHS_SPP=$(PATHS_SPP) \ -D SPPSYM_PATHS_MK=$(PATHS_MK) \ $(ADESPP_FLAGS) $< adeconf: adeconf.spp $(UTILS_SH_SPP) adespp \ $(GEP_SH_SPP) $(PATHS_MK) $(PATHS_SPP) $(PERL_CMD) ./adespp \ -D SPPSYM_PATHS_SPP=$(PATHS_SPP) \ -D SPPSYM_PATHS_MK=$(PATHS_MK) \ $(ADESPP_FLAGS) $< install: compile $(ADEINST_CMD) -m 755 $(OWNER) $(GROUP) -d \ $(BINDIR) $(ADEINST_CMD) $(OWNER) $(GROUP) -m 755 \ $(BIN_FILES) $(BINDIR) uninstall: -cd $(BINDIR) && rm -f $(BIN_FILES) -cd / && rmdir $(BINDIR) distclean: clean tests: