Skip to contentSkip to conversation

scripts/gdb: rebuild constants.py on dependancy change

PATCH New [email protected] 1 participant 1 message Jul 14, 2016 GDB kernel debugging helper scripts

lore
Share & tools
lore
#0 lore raw

PATCH 4/20 scripts/gdb: rebuild constants.py on dependancy change

From: Kieran Bingham <[email protected]>
Subject: scripts/gdb: rebuild constants.py on dependancy change

The autogenerated constants.py file was only being built on the initial call, and if the constants.py.in file changed. As we are utilising the CPP hooks, we can successfully use the call if_changed_dep rules to determine when to rebuild the file based on it's inclusions.

---

 scripts/gdb/linux/Makefile |    5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
scripts/gdb/linux/Makefile renamed from scripts/gdb/linux/Makefile~scripts-gdb-rebuild-constantspy-on-dependancy-change +3 -2
diff -puN scripts/gdb/linux/Makefile~scripts-gdb-rebuild-constantspy-on-dependancy-change scripts/gdb/linux/Makefile
@@ -13,8 +13,9 @@ quiet_cmd_gen_constants_py = GEN     $@
 	$(CPP) -E -x c -P $(c_flags) $< > $@ ;\
 	sed -i '1,/<!-- end-c-headers -->/d;' $@
 
-$(obj)/constants.py: $(SRCTREE)/$(obj)/constants.py.in
-	$(call if_changed,gen_constants_py)
+targets += constants.py
+$(obj)/constants.py: $(SRCTREE)/$(obj)/constants.py.in FORCE
+	$(call if_changed_dep,gen_constants_py)
 
 build_constants_py: $(obj)/constants.py
 	@:

_