Patchwork [15/16] petitboot: Add header deps to makefile

login
register
mail settings
Submitter Geoff Levand
Date Feb. 28, 2009, 12:54 a.m.
Message ID <20090228005351.051812512@am.sony.com>
Download mbox | patch
Permalink /patch/23860/
State Accepted
Headers show

Comments

Geoff Levand - Feb. 28, 2009, 12:54 a.m.
Add a dependency on the header files so a rebuild is done
when they change.

This is just an interim change.  The dependencies should be
found using gcc and its -MD option.

Signed-off-by: Geoff Levand <geoffrey.levand@am.sony.com>
---
 rules.mk |   17 ++++++++++++-----
 1 file changed, 12 insertions(+), 5 deletions(-)

Patch

--- a/rules.mk
+++ b/rules.mk
@@ -51,19 +51,26 @@  twin_objs = ui/twin/pb-twin.o
 # Makefiles
 makefiles = Makefile $(top_srcdir)/rules.mk
 
+# headers
+discover_all_headers = $(wildcard $(top_srcdir)/discover/*.h)
+lib_headers = $(wildcard $(top_srcdir)/lib/*/*.h)
+ui_all_headers = $(wildcard $(top_srcdir)/ui/*/*.h)
+
 # object collections
 lib_objs = $(list_objs) $(log_objs) $(protocol_objs) $(talloc_objs) \
 	$(waiter_objs)
 
 daemon_objs = $(lib_objs) $(parser_objs) $(discover_objs)
+daemon_headers = $(lib_headers) $(discover_all_headers)
 
 client_objs = $(lib_objs) $(ui_common_objs)
+client_headers = $(lib_headers) $(discover_all_headers) $(ui_all_headers)
 
 all: $(uis) $(daemons)
 
 # ncurses cui
 pb_cui_objs = $(client_objs) $(ncurses_objs) ui/ncurses/ps3-cui.o
-$(pb_cui_objs): $(makefiles)
+$(pb_cui_objs): $(makefiles) $(client_headers)
 
 $(pb_cui): LDFLAGS += -lncurses
 
@@ -72,14 +79,14 @@  $(pb_cui): $(pb_cui_objs)
 
 # test ui
 pb_test_objs = $(client_objs) ui/test/pb-test.o
-$(pb_test_objs): $(makefiles)
+$(pb_test_objs): $(makefiles) $(client_headers)
 
 $(pb_test): $(pb_test_objs)
 	$(LINK.o) -o $@ $^
 
 # twin gui
 pb_twin_objs = $(client_objs) $(twin_objs) ui/twin/ps3-twin.o
-$(pb_twin_objs): $(makefiles)
+$(pb_twin_objs): $(makefiles) $(client_headers)
 
 $(pb_twin): LDFLAGS+=$(twin_LDFLAGS) $(LIBTWIN)
 $(pb_twin): CFLAGS+=$(twin_CFLAGS)
@@ -89,14 +96,14 @@  $(pb_twin): $(pb_twin_objs)
 
 # discovery daemon
 pb_discover_objs = $(daemon_objs) discover/pb-discover.o
-$(pb_discover_objs): $(makefiles)
+$(pb_discover_objs): $(makefiles) $(daemon_headers)
 
 $(pb_discover): $(pb_discover_objs)
 	$(LINK.o) -o $@ $^
 
 # parser-test
 parser_test_objs = $(parser_objs) test/parser-test.o
-$(parser_test_objs): $(makefiles)
+$(parser_test_objs): $(makefiles) $(daemon_headers)
 
 $(parser_test): $(parser_test_objs)
 	$(LINK.o) -o $@ $^