@@ -463,3 +463,5 @@ endif
# information in a variable se we can use it in if_changed and friends.
.PHONY: $(PHONY)
+
+.SECONDARY:
require to change the order of the .c and .h in the prerequisite:
@@ -25,7 +25,7 @@ HOSTCFLAGS_dtc-lexer.lex.o := $(HOSTCFLAGS_DTC)
HOSTCFLAGS_dtc-parser.tab.o := $(HOSTCFLAGS_DTC)
# dependencies on generated files need to be listed explicitly
-$(obj)/dtc-parser.tab.o: $(obj)/dtc-parser.tab.c $(obj)/dtc-parser.tab.h
+$(obj)/dtc-parser.tab.o: $(obj)/dtc-parser.tab.h $(obj)/dtc-parser.tab.c
-$(obj)/dtc-lexer.lex.o: $(obj)/dtc-parser.tab.c $(obj)/dtc-parser.tab.h
+$(obj)/dtc-lexer.lex.o: $(obj)/dtc-parser.tab.h $(obj)/dtc-parser.tab.c
@@ -7,8 +7,8 @@ genksyms-objs := genksyms.o parse.tab.o lex.lex.o
# -I needed for generated C source (shipped source)
HOSTCFLAGS_parse.tab.o := -Wno-uninitialized -I$(src)
-$(obj)/parse.tab.o: $(obj)/parse.tab.c $(obj)/parse.tab.h
+$(obj)/parse.tab.o: $(obj)/parse.tab.h $(obj)/parse.tab.c
$(obj)/lex.lex.o: $(obj)/keywords.hash.c
-$(obj)/lex.lex.o: $(obj)/parse.tab.c $(obj)/parse.tab.h
+$(obj)/lex.lex.o: $(obj)/parse.tab.h $(obj)/parse.tab.c
else, the .h is regenerated first. Something we do not want. However,
if we revert the change to the precedent version, that is:
@@ -183,9 +183,11 @@ $(src)/%.lex.c_shipped: $(src)/%.l
quiet_cmd_bison = YACC $@
cmd_bison = bison -o$@ -d -t -l -p $(if
$(YACC_PREFIX_${baseprereq}),$(YACC_PREFIX_${baseprereq}),yy) $<
-$(src)/%.tab.c_shipped $(src)/%.tab.h_shipped: $(src)/%.y
+$(src)/%.tab.c_shipped: $(src)/%.y
$(call cmd,bison)
+$(src)/%.tab.h_shipped: $(src)/%.tab.c_shipped
+
which would seem more "logical", the chaining breaks: