From 85f7b0b468ce886380c585535767024a59b2af85 Mon Sep 17 00:00:00 2001 From: Damien George Date: Thu, 25 May 2017 21:43:01 +1000 Subject: [PATCH] py/mkrules.mk: Fix auto-qstr generation when "make -B" is used. For make v3.81, using "make -B" can set $? to empty and in this case the auto-qstr generation needs to pass all args (ie $^) to cpp. The previous fix for this (which was removed in 23a693ec2d8c2a194f61482dc0e1adb070fb6ad4) used if statements in the shell command, which gave very long lines that didn't work on certain systems (eg cygwin). The fix in this patch is to use an $if(...) expression, which will evaluate to $? (only newer prerequisites) if it's non empty, otherwise it will use $^ (all prerequisites). --- py/mkrules.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/py/mkrules.mk b/py/mkrules.mk index b37415e050..00ed279176 100644 --- a/py/mkrules.mk +++ b/py/mkrules.mk @@ -71,7 +71,7 @@ $(OBJ): | $(HEADER_BUILD)/qstrdefs.generated.h $(HEADER_BUILD)/mpversion.h $(HEADER_BUILD)/qstr.i.last: $(SRC_QSTR) | $(HEADER_BUILD)/mpversion.h $(ECHO) "GEN $@" - $(Q)$(CPP) $(QSTR_GEN_EXTRA_CFLAGS) $(CFLAGS) $? >$(HEADER_BUILD)/qstr.i.last; + $(Q)$(CPP) $(QSTR_GEN_EXTRA_CFLAGS) $(CFLAGS) $(if $?,$?,$^) >$(HEADER_BUILD)/qstr.i.last; $(HEADER_BUILD)/qstr.split: $(HEADER_BUILD)/qstr.i.last $(ECHO) "GEN $@"