Merge with master.kernel.org:/pub/scm/git/git.git
[gitweb.git] / Makefile
index 7ae12d88237aa033d0b5cbfdbb54a0781d1d5417..1f4f31b53bc1439688abc82cf46389a5a3d1f280 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -98,35 +98,29 @@ SCRIPT_PYTHON = \
 
 # The ones that do not have to link with lcrypto nor lz.
 SIMPLE_PROGRAMS = \
-       git-get-tar-commit-id git-mailinfo git-mailsplit git-stripspace \
-       git-var
-ifndef NO_IPV6
-# Not supported to IPv6-challenged platforms yet
-SIMPLE_PROGRAMS += git-daemon
-endif
+       git-get-tar-commit-id$(X) git-mailinfo$(X) git-mailsplit$(X) \
+       git-stripspace$(X) git-var$(X) git-daemon$(X)
 
 # ... and all the rest
 PROGRAMS = \
-       git-apply git-cat-file \
-       git-checkout-index git-clone-pack git-commit-tree \
-       git-convert-objects git-diff-files \
-       git-diff-index git-diff-stages \
-       git-diff-tree git-fetch-pack git-fsck-objects \
-       git-hash-object git-init-db \
-       git-local-fetch git-ls-files git-ls-tree git-merge-base \
-       git-merge-index git-mktag git-pack-objects git-patch-id \
-       git-peek-remote git-prune-packed git-read-tree \
-       git-receive-pack git-rev-list git-rev-parse \
-       git-send-pack git-show-branch \
-       git-show-index git-ssh-fetch \
-       git-ssh-upload git-tar-tree git-unpack-file \
-       git-unpack-objects git-update-index git-update-server-info \
-       git-upload-pack git-verify-pack git-write-tree \
-       git-update-ref \
-       $(SIMPLE_PROGRAMS)
+       git-apply$(X) git-cat-file$(X) git-checkout-index$(X)           \
+       git-clone-pack$(X) git-commit-tree$(X) git-convert-objects$(X)  \
+       git-diff-files$(X) git-diff-index$(X) git-diff-stages$(X)       \
+       git-diff-tree$(X) git-fetch-pack$(X) git-fsck-objects$(X)       \
+       git-hash-object$(X) git-init-db$(X) git-local-fetch$(X)         \
+       git-ls-files$(X) git-ls-tree$(X) git-merge-base$(X)             \
+       git-merge-index$(X) git-mktag$(X) git-pack-objects$(X)          \
+       git-patch-id$(X) git-peek-remote$(X) git-prune-packed$(X)       \
+       git-read-tree$(X) git-receive-pack$(X) git-rev-list$(X)         \
+       git-rev-parse$(X) git-send-pack$(X) git-show-branch$(X)         \
+       git-show-index$(X) git-ssh-fetch$(X) git-ssh-upload$(X)         \
+       git-tar-tree$(X) git-unpack-file$(X) git-unpack-objects$(X)     \
+       git-update-index$(X) git-update-server-info$(X)                 \
+       git-upload-pack$(X) git-verify-pack$(X) git-write-tree$(X)      \
+       git-update-ref$(X) $(SIMPLE_PROGRAMS)
 
 # Backward compatibility -- to be removed in 0.99.8
-PROGRAMS += git-ssh-pull git-ssh-push
+PROGRAMS += git-ssh-pull$(X) git-ssh-push$(X)
 
 PYMODULES = \
        gitMergeCommon.py
@@ -182,6 +176,7 @@ ifeq ($(shell uname -o),Cygwin)
        NO_STRCASESTR = YesPlease
        NEEDS_LIBICONV = YesPlease
        NO_IPV6 = YesPlease
+       X = .exe
 endif
 ifneq (,$(findstring arm,$(shell uname -m)))
        ARM_SHA1 = YesPlease
@@ -195,7 +190,7 @@ ifndef NO_CURL
        else
                CURL_LIBCURL = -lcurl
        endif
-       PROGRAMS += git-http-fetch
+       PROGRAMS += git-http-fetch$(X)
 endif
 
 ifndef SHELL_PATH
@@ -304,30 +299,30 @@ $(patsubst %.py,%,$(SCRIPT_PYTHON)) : % : %.py
 %.o: %.S
        $(CC) -o $*.o -c $(ALL_CFLAGS) $<
 
-git-%: %.o $(LIB_FILE)
+git-%$(X): %.o $(LIB_FILE)
        $(CC) $(ALL_CFLAGS) -o $@ $(filter %.o,$^) $(LIBS)
 
-git-mailinfo : SIMPLE_LIB += $(LIB_4_ICONV)
+git-mailinfo$(X) : SIMPLE_LIB += $(LIB_4_ICONV)
 $(SIMPLE_PROGRAMS) : $(LIB_FILE)
-$(SIMPLE_PROGRAMS) : git-% : %.o
+$(SIMPLE_PROGRAMS) : git-%$(X) : %.o
        $(CC) $(ALL_CFLAGS) -o $@ $(filter %.o,$^) $(LIB_FILE) $(SIMPLE_LIB)
 
-git-http-fetch: fetch.o
-git-local-fetch: fetch.o
-git-ssh-fetch: rsh.o fetch.o
-git-ssh-upload: rsh.o
-git-ssh-pull: rsh.o fetch.o
-git-ssh-push: rsh.o
+git-http-fetch$(X): fetch.o
+git-local-fetch$(X): fetch.o
+git-ssh-fetch$(X): rsh.o fetch.o
+git-ssh-upload$(X): rsh.o
+git-ssh-pull$(X): rsh.o fetch.o
+git-ssh-push$(X): rsh.o
 
-git-http-fetch: LIBS += $(CURL_LIBCURL)
-git-rev-list: LIBS += $(OPENSSL_LIBSSL)
+git-http-fetch$(X): LIBS += $(CURL_LIBCURL)
+git-rev-list$(X): LIBS += $(OPENSSL_LIBSSL)
 
 init-db.o: init-db.c
        $(CC) -c $(ALL_CFLAGS) \
                -DDEFAULT_GIT_TEMPLATE_DIR='"$(template_dir)"' $*.c
 
 $(LIB_OBJS): $(LIB_H)
-$(patsubst git-%,%.o,$(PROGRAMS)): $(LIB_H)
+$(patsubst git-%$(X),%.o,$(PROGRAMS)): $(LIB_H)
 $(DIFF_OBJS): diffcore.h
 
 $(LIB_FILE): $(LIB_OBJS)
@@ -342,10 +337,10 @@ doc:
 test: all
        $(MAKE) -C t/ all
 
-test-date: test-date.c date.o
+test-date$(X): test-date.c date.o
        $(CC) $(ALL_CFLAGS) -o $@ test-date.c date.o
 
-test-delta: test-delta.c diff-delta.o patch-delta.o
+test-delta$(X): test-delta.c diff-delta.o patch-delta.o
        $(CC) $(ALL_CFLAGS) -o $@ $^
 
 check:
@@ -395,7 +390,7 @@ deb: dist
 ### Cleaning rules
 
 clean:
-       rm -f *.o *.exe mozilla-sha1/*.o ppc/*.o compat/*.o $(PROGRAMS) $(LIB_FILE)
+       rm -f *.o mozilla-sha1/*.o ppc/*.o compat/*.o $(PROGRAMS) $(LIB_FILE)
        rm -f $(filter-out gitk,$(SCRIPTS))
        rm -f git-core.spec *.pyc *.pyo
        rm -rf $(GIT_TARNAME)