Makefile: do not link three copies of git-remote-* programs
Instead, link only one and make the rest hardlinks/copies, like we do for the built-ins. Signed-off-by: Junio C Hamano <gitster@pobox.com>
Junio C Hamano committed
Aug 6, 2009 at 22:08 UTC
611c7f6a373fc6e7140f81bf9c26bde9f78390d4
1 file changed
+10
-2
Makefile
+10
-2
@@ -980,7 +980,8 @@ else
980
else
981
CURL_LIBCURL = -lcurl
982
endif
983
- PROGRAMS += git-remote-http$X git-remote-https$X git-remote-ftp$X git-http-fetch$X
983
+ CURL_SYNONYMS = git-remote-https$X git-remote-ftp$X
984
+ PROGRAMS += git-remote-http$X $(CURL_SYNONYMS) git-http-fetch$X
985
curl_check := $(shell (echo 070908; curl-config --vernum) | sort -r | sed -ne 2p)
986
ifeq "$(curl_check)" "070908"
987
ifndef NO_EXPAT
@@ -1256,6 +1257,7 @@ ifndef V
1257
QUIET_LINK = @echo ' ' LINK $@;
1258
QUIET_BUILT_IN = @echo ' ' BUILTIN $@;
1259
QUIET_GEN = @echo ' ' GEN $@;
1260
+ QUIET_LNCP = @echo ' ' LN/CP $@;
1261
QUIET_SUBDIR0 = +@subdir=
1262
QUIET_SUBDIR1 = ;$(NO_SUBDIR) echo ' ' SUBDIR $$subdir; \
1263
$(MAKE) $(PRINT_DIR) -C $$subdir
@@ -1494,10 +1496,16 @@ git-http-push$X: revision.o http.o http-push.o $(GITLIBS)
1496
$(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) \
1497
$(LIBS) $(CURL_LIBCURL) $(EXPAT_LIBEXPAT)
1498
1497
-git-remote-http$X git-remote-https$X git-remote-ftp$X: remote-curl.o http.o http-walker.o $(GITLIBS)
1499
+git-remote-http$X: remote-curl.o http.o http-walker.o $(GITLIBS)
1500
$(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) \
1501
$(LIBS) $(CURL_LIBCURL) $(EXPAT_LIBEXPAT)
1502
1503
+$(CURL_SYNONYMS): git-remote-http$X
1504
+ $(QUIET_LNCP)$(RM) $@ && \
1505
+ ln $< $@ 2>/dev/null || \
1506
+ ln -s $< $@ 2>/dev/null || \
1507
+ cp $< $@
1508
+
1509
$(LIB_OBJS) $(BUILTIN_OBJS): $(LIB_H)
1510
$(patsubst git-%$X,%.o,$(PROGRAMS)) git.o: $(LIB_H) $(wildcard */*.h)
1511
builtin-revert.o wt-status.o: wt-status.h