From fd9c4a2afbbd9c1f054f000e0f752d6f51b62c3e Mon Sep 17 00:00:00 2001 From: Christophe de Dinechin Date: Tue, 8 May 2018 10:47:48 +0200 Subject: [PATCH] Fix order-only so that it does not introduce hard dependencies With pre-3.80 make, the rules would introduce hard dependencies instead of order-only dependencies, leading to a complete rebuild of everything with every 'make' --- rules.mk | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/rules.mk b/rules.mk index 300bb90..6d9d0b6 100644 --- a/rules.mk +++ b/rules.mk @@ -151,6 +151,10 @@ MIQ_INDEX:= 1 MIQ_COUNT:= $(words $(MIQ_SOURCES)) MIQ_PROFOUT:= $(subst $(EXE_EXT),,$(MIQ_OUTEXE))_prof_$(GIT_REVISION).vsp +ifeq (3.80,$(firstword $(sort $(MAKE_VERSION) 3.80))) +MIQ_ORDERONLY=| +endif + #------------------------------------------------------------------------------ # User targets @@ -303,7 +307,7 @@ endif #------------------------------------------------------------------------------ .recurse: $(SUBDIRS:%=%.recurse) -%.recurse: | .hello .prebuild +%.recurse: $(MIQ_ORDERONLY:%=% .hello .prebuild) +$(PRINT_COMMAND) cd $* && $(MIQ_RECURSE) %.variant: @@ -366,11 +370,7 @@ ifdef RECURSE MIQ_DEPENDENCIES=$(MIQ_SOURCES:%=$(MIQ_OBJDIR)%$(OBJ_EXT).d) MIQ_OBJDIR_DEPS=$(MIQ_OBJDIR)%.deps/.mkdir -ifeq (3.80,$(firstword $(sort $(MAKE_VERSION) 3.80))) -MIQ_OBJDEPS=$(MIQ_OBJDIR_DEPS) $(MIQ_MAKEDEPS) | .prebuild -else -MIQ_OBJDEPS=$(MIQ_OBJDIR_DEPS) $(MIQ_MAKEDEPS) .prebuild -endif +MIQ_OBJDEPS=$(MIQ_OBJDIR_DEPS) $(MIQ_MAKEDEPS) $(MIQ_ORDERONLY:%=% .prebuild) # Check if the compiler supports dependency flags (if not, do it the hard way) ifndef CFLAGS_DEPENDENCIES