Code

[PATCH] Build commands through object files
authorPetr Baudis <pasky@suse.cz>
Fri, 29 Jul 2005 17:21:53 +0000 (19:21 +0200)
committerJunio C Hamano <junkio@cox.net>
Sat, 30 Jul 2005 00:21:53 +0000 (17:21 -0700)
Separate the process of building the commands to compilation and
linkage. This makes it more consistent with the library objects, is the
traditional thing to do, and significantly speeds up the subsequent
rebuilds, especially for us the people who develop git on 300MHz
notebooks.

Ported from Cogito.

Signed-off-by: Petr Baudis <pasky@ucw.cz>
Signed-off-by: Junio C Hamano <junkio@cox.net>
Makefile

index d7d4182e09cdc3b16b7db31754889db5d6c2380e..f2677be0366b521913942bebc340c59aa3dd620d 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -137,13 +137,14 @@ CFLAGS += '-DSHA1_HEADER=$(SHA1_HEADER)'
 all: $(PROG)
 
 
-git-%: %.c $(LIB_FILE)
-       $(CC) $(CFLAGS) -o $@ $(filter %.c,$^) $(LIBS)
-
-git-http-pull: pull.c
-git-local-pull: pull.c
-git-ssh-pull: rsh.c pull.c
-git-ssh-push: rsh.c
+.PRECIOUS: %.o
+git-%: %.o $(LIB_FILE)
+       $(CC) $(CFLAGS) -o $@ $(filter %.o,$^) $(LIBS)
+
+git-http-pull: pull.o
+git-local-pull: pull.o
+git-ssh-pull: rsh.o pull.o
+git-ssh-push: rsh.o
 
 git-http-pull: LIBS += -lcurl
 git-rev-list: LIBS += -lssl