Makefile: Use generic rule to build test programs
Use a generic make rule to build all the test programs, rather than specifically mentioning each one. Signed-off-by: Julian Phillips <julian@quantumfyre.co.uk> Signed-off-by: Junio C Hamano <junkio@cox.net>
Julian Phillips committed
May 31, 2007 at 00:18 UTC
5c5ba73b21a6910ee67d97cb87a5d78409112375
1 file changed
+5
-19
Makefile
+5
-19
@@ -942,7 +942,7 @@ endif
942
943
### Testing rules
944
945
-TEST_PROGRAMS = test-chmtime$X test-genrandom$X
945
+TEST_PROGRAMS = test-chmtime$X test-genrandom$X test-date$X test-delta$X test-sha1$X test-match-trees$X
946
947
all:: $(TEST_PROGRAMS)
948
@@ -955,26 +955,12 @@ export NO_SVN_TESTS
955
test: all
956
$(MAKE) -C t/ all
957
958
-test-date$X: test-date.c date.o ctype.o
959
- $(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) test-date.c date.o ctype.o
958
+test-date$X: date.o ctype.o
959
961
-test-delta$X: test-delta.o diff-delta.o patch-delta.o $(GITLIBS)
962
- $(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) $(LIBS)
960
+test-delta$X: diff-delta.o patch-delta.o
961
964
-test-dump-cache-tree$X: dump-cache-tree.o $(GITLIBS)
965
- $(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) $(LIBS)
966
-
967
-test-sha1$X: test-sha1.o $(GITLIBS)
968
- $(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) $(LIBS)
969
-
970
-test-match-trees$X: test-match-trees.o $(GITLIBS)
971
- $(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) $(LIBS)
972
-
973
-test-chmtime$X: test-chmtime.c
974
- $(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $<
975
-
976
-test-genrandom$X: test-genrandom.c
977
- $(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $<
962
+test-%$X: test-%.o $(GITLIBS)
963
+ $(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) $(LIBS)
964
965
check-sha1:: test-sha1$X
966
./test-sha1.sh