diff --git a/configure/RULES_DIRS b/configure/RULES_DIRS index e90006890..92d2035dc 100644 --- a/configure/RULES_DIRS +++ b/configure/RULES_DIRS @@ -54,7 +54,7 @@ $(foreach dir, $(DIRS), \ define DEP_template2 $(1)$$(DIVIDER)$(2) : $$(foreach ddir, $$($(1)_DEPEND_DIRS), \ - $$(addsuffix $$(DIVIDER)$(2),$$(ddir))) + $$(addsuffix $$(DIVIDER)$(2),$$(ddir))) | before-$(2) endef $(foreach action, $(ACTIONS), \ $(foreach dir, $(DIRS), \ @@ -81,14 +81,20 @@ dirPart = $(join $(dir $@), $(word 1, $(subst $(DIVIDER), ,$(notdir $@)))) actionArchPart = $(join $(word 2, $(subst $(DIVIDER), ,$(notdir $@))), \ $(addprefix $(DIVIDER),$(word 3, $(subst $(DIVIDER), ,$(notdir $@))))) -$(DIRS) $(dirActionTargets) $(dirArchTargets) $(dirActionArchTargets): pre-make +$(DIRS) $(dirActionTargets) $(dirArchTargets) $(dirActionArchTargets): $(MAKE) -C $(dirPart) $(actionArchPart) +# before-action rules are run once prior to recursing through the +# list of subdirectories and running the action rule in each one. +# See DEP_template2 above for how that rule ordering is achieved. +beforeActions = $(addprefix before-,$(ACTIONS)) +$(beforeActions): + $(ARCHS) $(ACTIONS) $(actionArchTargets) :%: \ $(foreach dir, $(DIRS), $(dir)$(DIVIDER)%) -.PHONY : $(DIRS) all host rebuild pre-make -.PHONY : $(ARCHS) $(ACTIONS) +.PHONY : $(DIRS) all host rebuild +.PHONY : $(ARCHS) $(ACTIONS) $(beforeActions) .PHONY : $(dirActionTargets) $(dirArchTargets) .PHONY : $(dirActionArchTargets) .PHONY : $(actionArchTargets) diff --git a/configure/RULES_TOP b/configure/RULES_TOP index 627f4b63c..d77e2a6c3 100644 --- a/configure/RULES_TOP +++ b/configure/RULES_TOP @@ -35,10 +35,10 @@ uninstall$(DIVIDER)%: $(RMDIR) $(addsuffix /$(subst uninstall$(DIVIDER),,$@), \ $(INSTALL_LOCATION_BIN) $(INSTALL_LOCATION_LIB)) -pre-make: - @$(if $(filter test-results, $(MAKECMDGOALS)), \ - $(RM) $(TEST_FAILURE_FILE)) -test-results: +before-runtests before-test-results: rm-failure-file +rm-failure-file: + @$(RM) $(TEST_FAILURE_FILE) +runtests test-results: $(PERL) $(TOOLS)/testFailures.pl $(TEST_FAILURE_FILE) help: @@ -74,7 +74,7 @@ help: @echo " xxxRecord.o" .PHONY: distclean cvsclean realuninstall archuninstall uninstallDirs -.PHONY: uninstall help +.PHONY: uninstall rm-failure-file help # Include /cfg/TOP_RULES* files from tops defined in RELEASE* files #