Skip to content

Commit 22764b2

Browse files
committed
Optionally skip linking/copying the built-ins
The dashed form of the built-ins is so passé. Signed-off-by: Johannes Schindelin <[email protected]>
1 parent d966095 commit 22764b2

File tree

1 file changed

+36
-17
lines changed

1 file changed

+36
-17
lines changed

Makefile

Lines changed: 36 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -354,6 +354,9 @@ all::
354354
# Define NO_INSTALL_HARDLINKS if you prefer to use either symbolic links or
355355
# copies to install built-in git commands e.g. git-cat-file.
356356
#
357+
# Define SKIP_DASHED_BUILT_INS if you do not need the dashed versions of the
358+
# built-ins to be linked/copied at all.
359+
#
357360
# Define USE_NED_ALLOCATOR if you want to replace the platforms default
358361
# memory allocators with the nedmalloc allocator written by Niall Douglas.
359362
#
@@ -780,6 +783,16 @@ BUILT_INS += git-whatchanged$X
780783
# what 'all' will build and 'install' will install in gitexecdir,
781784
# excluding programs for built-in commands
782785
ALL_PROGRAMS = $(PROGRAMS) $(SCRIPTS)
786+
ALL_PROGRAMS_AND_BUILT_INS = $(ALL_PROGRAMS)
787+
ifeq (,$(SKIP_DASHED_BUILT_INS))
788+
ALL_PROGRAMS_AND_BUILT_INS += $(BUILT_INS)
789+
else
790+
# git-upload-pack, git-receive-pack and git-upload-archive are special: they
791+
# are _expected_ to be present in the `bin/` directory in their dashed form.
792+
ALL_PROGRAMS_AND_BUILT_INS += git-receive-pack.exe
793+
ALL_PROGRAMS_AND_BUILT_INS += git-upload-archive.exe
794+
ALL_PROGRAMS_AND_BUILT_INS += git-upload-pack.exe
795+
endif
783796

784797
# what 'all' will build but not install in gitexecdir
785798
OTHER_PROGRAMS = git$X
@@ -2059,9 +2072,9 @@ profile-fast: profile-clean
20592072
$(MAKE) PROFILE=USE all
20602073

20612074

2062-
all:: $(ALL_PROGRAMS) $(SCRIPT_LIB) $(BUILT_INS) $(OTHER_PROGRAMS) GIT-BUILD-OPTIONS
2075+
all:: $(ALL_PROGRAMS_AND_BUILT_INS) $(SCRIPT_LIB) $(OTHER_PROGRAMS) GIT-BUILD-OPTIONS
20632076
ifneq (,$X)
2064-
$(QUIET_BUILT_IN)$(foreach p,$(patsubst %$X,%,$(filter %$X,$(ALL_PROGRAMS) $(BUILT_INS) git$X)), test -d '$p' -o '$p' -ef '$p$X' || $(RM) '$p';)
2077+
$(QUIET_BUILT_IN)$(foreach p,$(patsubst %$X,%,$(filter %$X,$(ALL_PROGRAMS_AND_BUILT_INS) git$X)), test -d '$p' -o '$p' -ef '$p$X' || $(RM) '$p';)
20652078
endif
20662079

20672080
all::
@@ -2924,7 +2937,7 @@ ifndef NO_TCLTK
29242937
$(MAKE) -C git-gui gitexecdir='$(gitexec_instdir_SQ)' install
29252938
endif
29262939
ifneq (,$X)
2927-
$(foreach p,$(patsubst %$X,%,$(filter %$X,$(ALL_PROGRAMS) $(BUILT_INS) git$X)), test '$(DESTDIR_SQ)$(gitexec_instdir_SQ)/$p' -ef '$(DESTDIR_SQ)$(gitexec_instdir_SQ)/$p$X' || $(RM) '$(DESTDIR_SQ)$(gitexec_instdir_SQ)/$p';)
2940+
$(foreach p,$(patsubst %$X,%,$(filter %$X,$(ALL_PROGRAMS_AND_BUILT_INS) git$X)), test '$(DESTDIR_SQ)$(gitexec_instdir_SQ)/$p' -ef '$(DESTDIR_SQ)$(gitexec_instdir_SQ)/$p$X' || $(RM) '$(DESTDIR_SQ)$(gitexec_instdir_SQ)/$p';)
29282941
endif
29292942

29302943
bindir=$$(cd '$(DESTDIR_SQ)$(bindir_SQ)' && pwd) && \
@@ -2942,21 +2955,27 @@ endif
29422955
} && \
29432956
for p in $(filter $(install_bindir_programs),$(BUILT_INS)); do \
29442957
$(RM) "$$bindir/$$p" && \
2945-
test -n "$(INSTALL_SYMLINKS)" && \
2946-
ln -s "git$X" "$$bindir/$$p" || \
2947-
{ test -z "$(NO_INSTALL_HARDLINKS)" && \
2948-
ln "$$bindir/git$X" "$$bindir/$$p" 2>/dev/null || \
2949-
ln -s "git$X" "$$bindir/$$p" 2>/dev/null || \
2950-
cp "$$bindir/git$X" "$$bindir/$$p" || exit; } \
2958+
if test -z "$(SKIP_DASHED_BUILT_INS)"; \
2959+
then \
2960+
test -n "$(INSTALL_SYMLINKS)" && \
2961+
ln -s "git$X" "$$bindir/$$p" || \
2962+
{ test -z "$(NO_INSTALL_HARDLINKS)" && \
2963+
ln "$$bindir/git$X" "$$bindir/$$p" 2>/dev/null || \
2964+
ln -s "git$X" "$$bindir/$$p" 2>/dev/null || \
2965+
cp "$$bindir/git$X" "$$bindir/$$p" || exit; }; \
2966+
fi \
29512967
done && \
29522968
for p in $(BUILT_INS); do \
29532969
$(RM) "$$execdir/$$p" && \
2954-
test -n "$(INSTALL_SYMLINKS)" && \
2955-
ln -s "$$destdir_from_execdir_SQ/$(bindir_relative_SQ)/git$X" "$$execdir/$$p" || \
2956-
{ test -z "$(NO_INSTALL_HARDLINKS)" && \
2957-
ln "$$execdir/git$X" "$$execdir/$$p" 2>/dev/null || \
2958-
ln -s "git$X" "$$execdir/$$p" 2>/dev/null || \
2959-
cp "$$execdir/git$X" "$$execdir/$$p" || exit; } \
2970+
if test -z "$(SKIP_DASHED_BUILT_INS)"; \
2971+
then \
2972+
test -n "$(INSTALL_SYMLINKS)" && \
2973+
ln -s "$$destdir_from_execdir_SQ/$(bindir_relative_SQ)/git$X" "$$execdir/$$p" || \
2974+
{ test -z "$(NO_INSTALL_HARDLINKS)" && \
2975+
ln "$$execdir/git$X" "$$execdir/$$p" 2>/dev/null || \
2976+
ln -s "git$X" "$$execdir/$$p" 2>/dev/null || \
2977+
cp "$$execdir/git$X" "$$execdir/$$p" || exit; }; \
2978+
fi \
29602979
done && \
29612980
remote_curl_aliases="$(REMOTE_CURL_ALIASES)" && \
29622981
for p in $$remote_curl_aliases; do \
@@ -3047,7 +3066,7 @@ ifneq ($(INCLUDE_DLLS_IN_ARTIFACTS),)
30473066
OTHER_PROGRAMS += $(shell echo *.dll t/helper/*.dll)
30483067
endif
30493068

3050-
artifacts-tar:: $(ALL_PROGRAMS) $(SCRIPT_LIB) $(BUILT_INS) $(OTHER_PROGRAMS) \
3069+
artifacts-tar:: $(ALL_PROGRAMS_AND_BUILT_INS) $(SCRIPT_LIB) $(OTHER_PROGRAMS) \
30513070
GIT-BUILD-OPTIONS $(TEST_PROGRAMS) $(test_bindir_programs) \
30523071
$(MOFILES)
30533072
$(QUIET_SUBDIR0)templates $(QUIET_SUBDIR1) \
@@ -3142,7 +3161,7 @@ endif
31423161

31433162
### Check documentation
31443163
#
3145-
ALL_COMMANDS = $(ALL_PROGRAMS) $(SCRIPT_LIB) $(BUILT_INS)
3164+
ALL_COMMANDS = $(ALL_PROGRAMS_AND_BUILT_INS) $(SCRIPT_LIB)
31463165
ALL_COMMANDS += git
31473166
ALL_COMMANDS += gitk
31483167
ALL_COMMANDS += gitweb

0 commit comments

Comments
 (0)