diff --git a/configure/RULES_ARCHS b/configure/RULES_ARCHS index dfa42307d..b1d2d423e 100644 --- a/configure/RULES_ARCHS +++ b/configure/RULES_ARCHS @@ -12,8 +12,6 @@ all: install -rebuild: clean install - ACTIONS = inc ACTIONS += build ACTIONS += install @@ -46,7 +44,7 @@ CROSS_ARCHS += $(CROSS1) $(CROSS2) define DEP_template $(2): $$(EPICS_HOST_ARCH) -$(1)$$(DIVIDER)$(2): $(1)$$(DIVIDER)$$(EPICS_HOST_ARCH) +$(1)$$(DIVIDER)$(2): $(1)$$(DIVIDER)$$(EPICS_HOST_ARCH) O.$(2) endef $(foreach action, $(ACTIONS), $(foreach arch,\ @@ -55,6 +53,12 @@ $(foreach action, $(ACTIONS), $(foreach arch,\ #endif #************************************************************************* +# Allows rebuild to work with parallel builds option, -j. +ifeq (rebuild,$(filter rebuild,$(MAKECMDGOALS))) +$(buildDirs) O.Common : clean +rebuild: install +endif + $(actionArchTargets) : $(buildDirs) O.Common $(MAKE) -C O.$(archPart) -f ../Makefile TOP=$(TOP)/.. T_A=$(archPart) $(actionPart) @@ -86,5 +90,5 @@ realclean :: .PHONY : $(actionArchTargets) .PHONY : $(cleanArchTargets) -.PHONY : $(BUILD_ARCHS) +.PHONY : $(BUILD_ARCHS) rebuild .PHONY : $(ACTIONS) clean realclean archclean all diff --git a/configure/RULES_BUILD b/configure/RULES_BUILD index e750612f1..fb74153c7 100644 --- a/configure/RULES_BUILD +++ b/configure/RULES_BUILD @@ -115,6 +115,9 @@ install: buildInstall buildInstall : build +# Allows rebuild to work with parallel builds option, -j. +install: $(patsubst rebuild,clean,$(filter rebuild,$(MAKECMDGOALS))) + rebuild: clean install build : inc diff --git a/configure/RULES_DIRS b/configure/RULES_DIRS index 0e5a0bbea..b806ba6c0 100644 --- a/configure/RULES_DIRS +++ b/configure/RULES_DIRS @@ -35,7 +35,12 @@ actionArchTargets = $(foreach action, $(ACTIONS),\ all : install -rebuild : clean install +# Allows rebuild to work with parallel builds option, -j. +ifeq (rebuild,$(filter rebuild,$(MAKECMDGOALS))) +$(foreach dir, $(DIRS), $(dir)$(DIVIDER)install): \ + $(foreach dir, $(DIRS), $(dir)$(DIVIDER)clean) +rebuild: $(foreach dir, $(DIRS), $(dir)$(DIVIDER)install) +endif # Create directory dependancies lines for GNU make -j option # Only works with GNU make 3.81 or later (uses eval function)