Skip to content

Commit

Permalink
Makefile: list standalone program object files in PROGRAM_OBJS
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Jonathan Nieder committed Jan 27, 2010
1 parent dfea575 commit 1b22c99
Showing 1 changed file with 16 additions and 12 deletions.
28 changes: 16 additions & 12 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -341,6 +341,7 @@ COMPAT_CFLAGS =
COMPAT_OBJS =
LIB_H =
LIB_OBJS =
PROGRAM_OBJS =
PROGRAMS =
SCRIPT_PERL =
SCRIPT_PYTHON =
Expand Down Expand Up @@ -390,12 +391,15 @@ EXTRA_PROGRAMS =

# ... and all the rest that could be moved out of bindir to gitexecdir
PROGRAMS += $(EXTRA_PROGRAMS)
PROGRAMS += git-fast-import$X
PROGRAMS += git-imap-send$X
PROGRAMS += git-shell$X
PROGRAMS += git-show-index$X
PROGRAMS += git-upload-pack$X
PROGRAMS += git-http-backend$X

PROGRAM_OBJS += fast-import.o
PROGRAM_OBJS += imap-send.o
PROGRAM_OBJS += shell.o
PROGRAM_OBJS += show-index.o
PROGRAM_OBJS += upload-pack.o
PROGRAM_OBJS += http-backend.o

PROGRAMS += $(patsubst %.o,git-%$X,$(PROGRAM_OBJS))

TEST_PROGRAMS_NEED_X += test-chmtime
TEST_PROGRAMS_NEED_X += test-ctype
Expand Down Expand Up @@ -1139,11 +1143,12 @@ else
REMOTE_CURL_PRIMARY = git-remote-http$X
REMOTE_CURL_ALIASES = git-remote-https$X git-remote-ftp$X git-remote-ftps$X
REMOTE_CURL_NAMES = $(REMOTE_CURL_PRIMARY) $(REMOTE_CURL_ALIASES)
PROGRAMS += $(REMOTE_CURL_NAMES) git-http-fetch$X
PROGRAM_OBJS += http-fetch.o
PROGRAMS += $(REMOTE_CURL_NAMES)
curl_check := $(shell (echo 070908; curl-config --vernum) | sort -r | sed -ne 2p)
ifeq "$(curl_check)" "070908"
ifndef NO_EXPAT
PROGRAMS += git-http-push$X
PROGRAM_OBJS += http-push.o
endif
endif
ifndef NO_EXPAT
Expand All @@ -1163,7 +1168,7 @@ endif
EXTLIBS += -lz

ifndef NO_POSIX_ONLY_PROGRAMS
PROGRAMS += git-daemon$X
PROGRAM_OBJS += daemon.o
endif
ifndef NO_OPENSSL
OPENSSL_LIBSSL = -lssl
Expand Down Expand Up @@ -1670,9 +1675,8 @@ git.o git.spec \
$(patsubst %.perl,%,$(SCRIPT_PERL)) \
: GIT-VERSION-FILE

GIT_OBJS := $(LIB_OBJS) $(BUILTIN_OBJS) $(TEST_OBJS) \
git.o http.o http-walker.o remote-curl.o \
$(patsubst git-%$X,%.o,$(PROGRAMS))
GIT_OBJS := $(LIB_OBJS) $(BUILTIN_OBJS) $(PROGRAM_OBJS) $(TEST_OBJS) \
git.o http.o http-walker.o remote-curl.o
XDIFF_OBJS = xdiff/xdiffi.o xdiff/xprepare.o xdiff/xutils.o xdiff/xemit.o \
xdiff/xmerge.o xdiff/xpatience.o
OBJECTS := $(GIT_OBJS) $(XDIFF_OBJS)
Expand Down

0 comments on commit 1b22c99

Please sign in to comment.