@@ -315,6 +315,7 @@ PROGRAMS =
315315SCRIPT_PERL =
316316SCRIPT_PYTHON =
317317SCRIPT_SH =
318+ SCRIPT_LIB =
318319TEST_PROGRAMS =
319320
320321SCRIPT_SH += git-am.sh
@@ -326,20 +327,21 @@ SCRIPT_SH += git-merge-octopus.sh
326327SCRIPT_SH += git-merge-one-file.sh
327328SCRIPT_SH += git-merge-resolve.sh
328329SCRIPT_SH += git-mergetool.sh
329- SCRIPT_SH += git-mergetool--lib.sh
330330SCRIPT_SH += git-notes.sh
331- SCRIPT_SH += git-parse-remote.sh
332331SCRIPT_SH += git-pull.sh
333332SCRIPT_SH += git-quiltimport.sh
334333SCRIPT_SH += git-rebase--interactive.sh
335334SCRIPT_SH += git-rebase.sh
336335SCRIPT_SH += git-repack.sh
337336SCRIPT_SH += git-request-pull.sh
338- SCRIPT_SH += git-sh-setup.sh
339337SCRIPT_SH += git-stash.sh
340338SCRIPT_SH += git-submodule.sh
341339SCRIPT_SH += git-web--browse.sh
342340
341+ SCRIPT_LIB += git-mergetool--lib
342+ SCRIPT_LIB += git-parse-remote
343+ SCRIPT_LIB += git-sh-setup
344+
343345SCRIPT_PERL += git-add--interactive.perl
344346SCRIPT_PERL += git-difftool.perl
345347SCRIPT_PERL += git-archimport.perl
@@ -1411,7 +1413,7 @@ export TAR INSTALL DESTDIR SHELL_PATH
14111413
14121414SHELL = $(SHELL_PATH )
14131415
1414- all :: shell_compatibility_test $(ALL_PROGRAMS ) $(BUILT_INS ) $(OTHER_PROGRAMS ) GIT-BUILD-OPTIONS
1416+ all :: shell_compatibility_test $(ALL_PROGRAMS ) $(SCRIPT_LIB ) $( BUILT_INS ) $(OTHER_PROGRAMS ) GIT-BUILD-OPTIONS
14151417ifneq (,$X)
14161418 $(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';)
14171419endif
@@ -1462,17 +1464,25 @@ common-cmds.h: ./generate-cmdlist.sh command-list.txt
14621464common-cmds.h : $(wildcard Documentation/git-* .txt)
14631465 $(QUIET_GEN ) ./generate-cmdlist.sh > $@ + && mv $@ + $@
14641466
1467+ define cmd_munge_script
1468+ $(RM ) $@ $@ + && \
1469+ sed -e '1s|# !.*/sh|#!$(SHELL_PATH_SQ)|' \
1470+ -e 's|@SHELL_PATH@|$(SHELL_PATH_SQ)|' \
1471+ -e 's/@@GIT_VERSION@@/$(GIT_VERSION)/g' \
1472+ -e 's/@@NO_CURL@@/$(NO_CURL)/g' \
1473+ -e $(BROKEN_PATH_FIX) \
1474+ $@.sh >$@+
1475+ endef
1476+
14651477$(patsubst % .sh,% ,$(SCRIPT_SH ) ) : % : % .sh
1466- $(QUIET_GEN )$(RM ) $@ $@ + && \
1467- sed -e ' 1s|#!.*/sh|#!$(SHELL_PATH_SQ)|' \
1468- -e ' s|@SHELL_PATH@|$(SHELL_PATH_SQ)|' \
1469- -e ' s/@@GIT_VERSION@@/$(GIT_VERSION)/g' \
1470- -e ' s/@@NO_CURL@@/$(NO_CURL)/g' \
1471- -e $(BROKEN_PATH_FIX ) \
1472- $@ .sh > $@ + && \
1478+ $(QUIET_GEN )$(cmd_munge_script ) && \
14731479 chmod +x $@ + && \
14741480 mv $@ + $@
14751481
1482+ $(SCRIPT_LIB ) : % : % .sh
1483+ $(QUIET_GEN )$(cmd_munge_script ) && \
1484+ mv $@ + $@
1485+
14761486ifndef NO_PERL
14771487$(patsubst % .perl,% ,$(SCRIPT_PERL ) ) : perl/perl.mak
14781488
@@ -1805,6 +1815,7 @@ install: all
18051815 $(INSTALL ) -d -m 755 ' $(DESTDIR_SQ)$(bindir_SQ)'
18061816 $(INSTALL ) -d -m 755 ' $(DESTDIR_SQ)$(gitexec_instdir_SQ)'
18071817 $(INSTALL ) $(ALL_PROGRAMS ) ' $(DESTDIR_SQ)$(gitexec_instdir_SQ)'
1818+ $(INSTALL ) -m 644 $(SCRIPT_LIB ) ' $(DESTDIR_SQ)$(gitexec_instdir_SQ)'
18081819 $(INSTALL ) $(install_bindir_programs ) ' $(DESTDIR_SQ)$(bindir_SQ)'
18091820 $(MAKE ) -C templates DESTDIR=' $(DESTDIR_SQ)' install
18101821ifndef NO_PERL
@@ -1924,7 +1935,7 @@ distclean: clean
19241935clean :
19251936 $(RM ) * .o block-sha1/* .o ppc/* .o compat/* .o compat/* /* .o xdiff/* .o \
19261937 $(LIB_FILE ) $(XDIFF_LIB )
1927- $(RM ) $(ALL_PROGRAMS ) $(BUILT_INS ) git$X
1938+ $(RM ) $(ALL_PROGRAMS ) $(SCRIPT_LIB ) $( BUILT_INS ) git$X
19281939 $(RM ) $(TEST_PROGRAMS )
19291940 $(RM ) -r bin-wrappers
19301941 $(RM ) * .spec * .pyc * .pyo * /* .pyc * /* .pyo common-cmds.h TAGS tags cscope*
@@ -1956,7 +1967,7 @@ endif
19561967# ## Check documentation
19571968#
19581969check-docs ::
1959- @ (for v in $( ALL_PROGRAMS) $( BUILT_INS) git gitk; \
1970+ @ (for v in $( ALL_PROGRAMS) $( SCRIPT_LIB ) $( BUILT_INS) git gitk; \
19601971 do \
19611972 case " $$ v" in \
19621973 git-merge-octopus | git-merge-ours | git-merge-recursive | \
@@ -1999,9 +2010,12 @@ check-docs::
19992010 documented,gitrepository-layout | \
20002011 documented,gittutorial | \
20012012 documented,gittutorial-2 | \
2013+ documented,git-bisect-lk2009 | \
2014+ documented.git-remote-helpers | \
2015+ documented,gitworkflows | \
20022016 sentinel,not,matching,is,ok ) continue ;; \
20032017 esac ; \
2004- case " $( ALL_PROGRAMS) $( BUILT_INS) git gitk " in \
2018+ case " $( ALL_PROGRAMS) $( SCRIPT_LIB ) $( BUILT_INS) git gitk " in \
20052019 * " $$ cmd " * ) ;; \
20062020 * ) echo " removed but $$ how: $$ cmd" ;; \
20072021 esac ; \
0 commit comments