Makefile: list standalone program object files in PROGRAM_OBJS
Because of new commands like git-remote-http, the OBJECTS list contains fictitious objects such as remote-http.o. Thus any out-of-tree rules that require all $(OBJECTS) to be buildable are broken. Add a list of real program objects to avoid this problem. To avoid duplication of effort, calculate the command list in the PROGRAMS variable using the expansion of PROGRAM_OBJS. This calculation occurs at the time $(PROGRAMS) is expanded, so later additions to PROGRAM_OBJS will be reflected in it, provided they occur before the build rules begin on line 1489. Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Jonathan Nieder committed
Jan 26, 2010 at 09:54 UTC
1b22c99c14b30f0add6f108a5883f003a2d81e01
1 file changed
+16
-12
Makefile
+16
-12
@@ -341,6 +341,7 @@ COMPAT_CFLAGS =
341
COMPAT_OBJS =
342
LIB_H =
343
LIB_OBJS =
344
+PROGRAM_OBJS =
345
PROGRAMS =
346
SCRIPT_PERL =
347
SCRIPT_PYTHON =
@@ -390,12 +391,15 @@ EXTRA_PROGRAMS =
391
392
# ... and all the rest that could be moved out of bindir to gitexecdir
393
PROGRAMS += $(EXTRA_PROGRAMS)
393
-PROGRAMS += git-fast-import$X
394
-PROGRAMS += git-imap-send$X
395
-PROGRAMS += git-shell$X
396
-PROGRAMS += git-show-index$X
397
-PROGRAMS += git-upload-pack$X
398
-PROGRAMS += git-http-backend$X
394
+
395
+PROGRAM_OBJS += fast-import.o
396
+PROGRAM_OBJS += imap-send.o
397
+PROGRAM_OBJS += shell.o
398
+PROGRAM_OBJS += show-index.o
399
+PROGRAM_OBJS += upload-pack.o
400
+PROGRAM_OBJS += http-backend.o
401
+
402
+PROGRAMS += $(patsubst %.o,git-%$X,$(PROGRAM_OBJS))
403
404
TEST_PROGRAMS_NEED_X += test-chmtime
405
TEST_PROGRAMS_NEED_X += test-ctype
@@ -1139,11 +1143,12 @@ else
1143
REMOTE_CURL_PRIMARY = git-remote-http$X
1144
REMOTE_CURL_ALIASES = git-remote-https$X git-remote-ftp$X git-remote-ftps$X
1145
REMOTE_CURL_NAMES = $(REMOTE_CURL_PRIMARY) $(REMOTE_CURL_ALIASES)
1142
- PROGRAMS += $(REMOTE_CURL_NAMES) git-http-fetch$X
1146
+ PROGRAM_OBJS += http-fetch.o
1147
+ PROGRAMS += $(REMOTE_CURL_NAMES)
1148
curl_check := $(shell (echo 070908; curl-config --vernum) | sort -r | sed -ne 2p)
1149
ifeq "$(curl_check)" "070908"
1150
ifndef NO_EXPAT
1146
- PROGRAMS += git-http-push$X
1151
+ PROGRAM_OBJS += http-push.o
1152
endif
1153
endif
1154
ifndef NO_EXPAT
@@ -1163,7 +1168,7 @@ endif
1168
EXTLIBS += -lz
1169
1170
ifndef NO_POSIX_ONLY_PROGRAMS
1166
- PROGRAMS += git-daemon$X
1171
+ PROGRAM_OBJS += daemon.o
1172
endif
1173
ifndef NO_OPENSSL
1174
OPENSSL_LIBSSL = -lssl
@@ -1670,9 +1675,8 @@ git.o git.spec \
1675
$(patsubst %.perl,%,$(SCRIPT_PERL)) \
1676
: GIT-VERSION-FILE
1677
1673
-GIT_OBJS := $(LIB_OBJS) $(BUILTIN_OBJS) $(TEST_OBJS) \
1674
- git.o http.o http-walker.o remote-curl.o \
1675
- $(patsubst git-%$X,%.o,$(PROGRAMS))
1678
+GIT_OBJS := $(LIB_OBJS) $(BUILTIN_OBJS) $(PROGRAM_OBJS) $(TEST_OBJS) \
1679
+ git.o http.o http-walker.o remote-curl.o
1680
XDIFF_OBJS = xdiff/xdiffi.o xdiff/xprepare.o xdiff/xutils.o xdiff/xemit.o \
1681
xdiff/xmerge.o xdiff/xpatience.o
1682
OBJECTS := $(GIT_OBJS) $(XDIFF_OBJS)