@matheusbsbs / matheus-bagliano / commits / daa99a9172
Fork 0

Makefile: make sure test helpers are rebuilt when headers change

It is not worth the bother to maintain an up-to-date list of which headers each test helper uses, so depend on $(LIB_H) to catch them all. Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>

Jonathan Nieder committed Jan 26, 2010 at 09:45 UTC daa99a917293d962ce565a04a09b0de08e32b8ba
1 file changed +16 -16
Makefile
+16 -16
@@ -402,6 +402,18 @@ PROGRAMS += git-upload-pack$X
402 PROGRAMS += git-var$X
403 PROGRAMS += git-http-backend$X
404
405 +TEST_PROGRAMS += test-chmtime$X
406 +TEST_PROGRAMS += test-ctype$X
407 +TEST_PROGRAMS += test-date$X
408 +TEST_PROGRAMS += test-delta$X
409 +TEST_PROGRAMS += test-dump-cache-tree$X
410 +TEST_PROGRAMS += test-genrandom$X
411 +TEST_PROGRAMS += test-match-trees$X
412 +TEST_PROGRAMS += test-parse-options$X
413 +TEST_PROGRAMS += test-path-utils$X
414 +TEST_PROGRAMS += test-sha1$X
415 +TEST_PROGRAMS += test-sigchain$X
416 +
417 # List built-in command $C whose implementation cmd_$C() is not in
418 # builtin-$C.o but is linked in as part of some other command.
419 BUILT_INS += $(patsubst builtin-%.o,git-%$X,$(BUILTIN_OBJS))
@@ -695,6 +707,8 @@ BUILTIN_OBJS += builtin-verify-pack.o
707 BUILTIN_OBJS += builtin-verify-tag.o
708 BUILTIN_OBJS += builtin-write-tree.o
709
710 +TEST_OBJS := $(patsubst test-%$X,test-%.o,$(TEST_PROGRAMS))
711 +
712 GITLIBS = $(LIB_FILE) $(XDIFF_LIB)
713 EXTLIBS =
714
@@ -1642,7 +1656,7 @@ git-remote-curl$X: remote-curl.o http.o http-walker.o $(GITLIBS)
1656 $(LIBS) $(CURL_LIBCURL) $(EXPAT_LIBEXPAT)
1657
1658 $(LIB_OBJS) $(BUILTIN_OBJS): $(LIB_H)
1645 -$(patsubst git-%$X,%.o,$(PROGRAMS)) git.o: $(LIB_H) $(wildcard */*.h)
1659 +$(patsubst git-%$X,%.o,$(PROGRAMS)) $(TEST_OBJS) git.o: $(LIB_H) $(wildcard */*.h)
1660 builtin-branch.o builtin-checkout.o builtin-clone.o builtin-reset.o branch.o: branch.h
1661 builtin-bundle.o bundle.o transport.o: bundle.h
1662 builtin-bisect--helper.o builtin-rev-list.o bisect.o: bisect.h
@@ -1732,18 +1746,6 @@ endif
1746
1747 ### Testing rules
1748
1735 -TEST_PROGRAMS += test-chmtime$X
1736 -TEST_PROGRAMS += test-ctype$X
1737 -TEST_PROGRAMS += test-date$X
1738 -TEST_PROGRAMS += test-delta$X
1739 -TEST_PROGRAMS += test-dump-cache-tree$X
1740 -TEST_PROGRAMS += test-genrandom$X
1741 -TEST_PROGRAMS += test-match-trees$X
1742 -TEST_PROGRAMS += test-parse-options$X
1743 -TEST_PROGRAMS += test-path-utils$X
1744 -TEST_PROGRAMS += test-sha1$X
1745 -TEST_PROGRAMS += test-sigchain$X
1746 -
1749 all:: $(TEST_PROGRAMS)
1750
1751 # GNU make supports exporting all variables by "export" without parameters.
@@ -1763,9 +1765,7 @@ test-delta$X: diff-delta.o patch-delta.o
1765
1766 test-parse-options$X: parse-options.o
1767
1766 -test-parse-options.o: parse-options.h
1767 -
1768 -.PRECIOUS: $(patsubst test-%$X,test-%.o,$(TEST_PROGRAMS))
1768 +.PRECIOUS: $(TEST_OBJS)
1769
1770 test-%$X: test-%.o $(GITLIBS)
1771 $(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) $(LIBS)