@@ -176,6 +176,7 @@ export prefix bindir gitexecdir sharedir template_dir sysconfdir
176176
177177CC = gcc
178178AR = ar
179+ RM = rm -f
179180TAR = tar
180181INSTALL = install
181182RPMBUILD = rpmbuild
@@ -729,7 +730,7 @@ export TAR INSTALL DESTDIR SHELL_PATH
729730
730731all :: $(ALL_PROGRAMS ) $(BUILT_INS ) $(OTHER_PROGRAMS )
731732ifneq (,$X)
732- $(foreach p,$(patsubst %$X,%,$(filter %$X,$(ALL_PROGRAMS) $(BUILT_INS) git$X)), rm -f '$p';)
733+ $(foreach p,$(patsubst %$X,%,$(filter %$X,$(ALL_PROGRAMS) $(BUILT_INS) git$X)), $(RM) '$p';)
733734endif
734735
735736all ::
@@ -743,7 +744,7 @@ strip: $(PROGRAMS) git$X
743744 $(STRIP ) $(STRIP_OPTS ) $(PROGRAMS ) git$X
744745
745746gitk-wish : gitk GIT-GUI-VARS
746- $(QUIET_GEN ) rm -f $@ $@ + && \
747+ $(QUIET_GEN )$( RM ) $@ $@ + && \
747748 sed -e ' 1,3s|^exec .* "$$0"|exec $(subst |,' \| ' ,$(TCLTK_PATH_SQ)) "$$0"|' < gitk > $@ + && \
748749 chmod +x $@ + && \
749750 mv -f $@ + $@
@@ -759,18 +760,18 @@ git$X: git.o $(BUILTIN_OBJS) $(GITLIBS)
759760help.o : common-cmds.h
760761
761762git-merge-subtree$X : git-merge-recursive$X
762- $(QUIET_BUILT_IN ) rm -f $@ && ln git-merge-recursive$X $@
763+ $(QUIET_BUILT_IN )$( RM ) $@ && ln git-merge-recursive$X $@
763764
764765$(BUILT_INS ) : git$X
765- $(QUIET_BUILT_IN ) rm -f $@ && ln git$X $@
766+ $(QUIET_BUILT_IN )$( RM ) $@ && ln git$X $@
766767
767768common-cmds.h : ./generate-cmdlist.sh
768769
769770common-cmds.h : $(wildcard Documentation/git-* .txt)
770771 $(QUIET_GEN ) ./generate-cmdlist.sh > $@ + && mv $@ + $@
771772
772773$(patsubst % .sh,% ,$(SCRIPT_SH ) ) : % : % .sh
773- $(QUIET_GEN ) rm -f $@ $@ + && \
774+ $(QUIET_GEN )$( RM ) $@ $@ + && \
774775 sed -e ' 1s|#!.*/sh|#!$(SHELL_PATH_SQ)|' \
775776 -e ' s|@@PERL@@|$(PERL_PATH_SQ)|g' \
776777 -e ' s/@@GIT_VERSION@@/$(GIT_VERSION)/g' \
@@ -782,7 +783,7 @@ $(patsubst %.sh,%,$(SCRIPT_SH)) : % : %.sh
782783$(patsubst % .perl,% ,$(SCRIPT_PERL ) ) : perl/perl.mak
783784
784785$(patsubst % .py,% ,$(SCRIPT_PYTHON ) ) : % : % .py
785- rm -f $@ $@ +
786+ $( RM ) $@ $@ +
786787 sed -e ' 1s|#!.*/python|#!$(PYTHON_PATH_SQ)|' \
787788 -e ' s/@@GIT_VERSION@@/$(GIT_VERSION)/g' \
788789 -e ' s/@@NO_CURL@@/$(NO_CURL)/g' \
@@ -794,7 +795,7 @@ perl/perl.mak: GIT-CFLAGS
794795 $(QUIET_SUBDIR0 ) perl $(QUIET_SUBDIR1 ) PERL_PATH=' $(PERL_PATH_SQ)' prefix=' $(prefix_SQ)' $(@F )
795796
796797$(patsubst % .perl,% ,$(SCRIPT_PERL ) ) : % : % .perl
797- $(QUIET_GEN ) rm -f $@ $@ + && \
798+ $(QUIET_GEN )$( RM ) $@ $@ + && \
798799 INSTLIBDIR=` $( MAKE) -C perl -s --no-print-directory instlibdir` && \
799800 sed -e ' 1{' \
800801 -e ' s|#!.*perl|#!$(PERL_PATH_SQ)|' \
@@ -813,7 +814,7 @@ git-status: git-commit
813814 $(QUIET_GEN ) cp $< $@ + && mv $@ + $@
814815
815816gitweb/gitweb.cgi : gitweb/gitweb.perl
816- $(QUIET_GEN ) rm -f $@ $@ + && \
817+ $(QUIET_GEN )$( RM ) $@ $@ + && \
817818 sed -e ' 1s|#!.*perl|#!$(PERL_PATH_SQ)|' \
818819 -e ' s|++GIT_VERSION++|$(GIT_VERSION)|g' \
819820 -e ' s|++GIT_BINDIR++|$(bindir)|g' \
@@ -836,7 +837,7 @@ gitweb/gitweb.cgi: gitweb/gitweb.perl
836837 mv $@ + $@
837838
838839git-instaweb : git-instaweb.sh gitweb/gitweb.cgi gitweb/gitweb.css
839- $(QUIET_GEN ) rm -f $@ $@ + && \
840+ $(QUIET_GEN )$( RM ) $@ $@ + && \
840841 sed -e ' 1s|#!.*/sh|#!$(SHELL_PATH_SQ)|' \
841842 -e ' s/@@GIT_VERSION@@/$(GIT_VERSION)/g' \
842843 -e ' s/@@NO_CURL@@/$(NO_CURL)/g' \
@@ -849,11 +850,11 @@ git-instaweb: git-instaweb.sh gitweb/gitweb.cgi gitweb/gitweb.css
849850 mv $@ + $@
850851
851852configure : configure.ac
852- $(QUIET_GEN ) rm -f $@ $< + && \
853+ $(QUIET_GEN )$( RM ) $@ $< + && \
853854 sed -e ' s/@@GIT_VERSION@@/$(GIT_VERSION)/g' \
854855 $< > $< + && \
855856 autoconf -o $@ $< + && \
856- rm -f $< +
857+ $( RM ) $< +
857858
858859# These can record GIT_VERSION
859860git.o git.spec \
@@ -908,15 +909,15 @@ $(patsubst git-%$X,%.o,$(PROGRAMS)): $(LIB_H) $(wildcard */*.h)
908909$(DIFF_OBJS ) : diffcore.h
909910
910911$(LIB_FILE ) : $(LIB_OBJS )
911- $(QUIET_AR ) rm -f $@ && $(AR ) rcs $@ $(LIB_OBJS )
912+ $(QUIET_AR )$( RM ) $@ && $(AR ) rcs $@ $(LIB_OBJS )
912913
913914XDIFF_OBJS =xdiff/xdiffi.o xdiff/xprepare.o xdiff/xutils.o xdiff/xemit.o \
914915 xdiff/xmerge.o
915916$(XDIFF_OBJS ) : xdiff/xinclude.h xdiff/xmacros.h xdiff/xdiff.h xdiff/xtypes.h \
916917 xdiff/xutils.h xdiff/xprepare.h xdiff/xdiffi.h xdiff/xemit.h
917918
918919$(XDIFF_LIB ) : $(XDIFF_OBJS )
919- $(QUIET_AR ) rm -f $@ && $(AR ) rcs $@ $(XDIFF_OBJS )
920+ $(QUIET_AR )$( RM ) $@ && $(AR ) rcs $@ $(XDIFF_OBJS )
920921
921922
922923perl/Makefile : perl/Git.pm perl/Makefile.PL GIT-CFLAGS
@@ -927,11 +928,11 @@ doc:
927928 $(MAKE ) -C Documentation all
928929
929930TAGS :
930- rm -f TAGS
931+ $( RM ) TAGS
931932 find . -name ' *.[hcS]' -print | xargs etags -a
932933
933934tags :
934- rm -f tags
935+ $( RM ) tags
935936 find . -name ' *.[hcS]' -print | xargs ctags -a
936937
937938# ## Detect prefix changes
@@ -1010,9 +1011,9 @@ endif
10101011 cp '$(DESTDIR_SQ)$(bindir_SQ)/git$X' \
10111012 '$(DESTDIR_SQ)$(gitexecdir_SQ)/git$X'; \
10121013 fi
1013- $(foreach p,$(BUILT_INS), rm -f '$(DESTDIR_SQ)$(gitexecdir_SQ)/$p' && ln '$(DESTDIR_SQ)$(gitexecdir_SQ)/git$X' '$(DESTDIR_SQ)$(gitexecdir_SQ)/$p' ;)
1014+ $(foreach p,$(BUILT_INS), $(RM) '$(DESTDIR_SQ)$(gitexecdir_SQ)/$p' && ln '$(DESTDIR_SQ)$(gitexecdir_SQ)/git$X' '$(DESTDIR_SQ)$(gitexecdir_SQ)/$p' ;)
10141015ifneq (,$X)
1015- $(foreach p,$(patsubst %$X,%,$(filter %$X,$(ALL_PROGRAMS) $(BUILT_INS) git$X)), rm -f '$(DESTDIR_SQ)$(gitexecdir_SQ)/$p';)
1016+ $(foreach p,$(patsubst %$X,%,$(filter %$X,$(ALL_PROGRAMS) $(BUILT_INS) git$X)), $(RM) '$(DESTDIR_SQ)$(gitexecdir_SQ)/$p';)
10161017endif
10171018
10181019install-doc :
@@ -1042,7 +1043,7 @@ dist: git.spec git-archive configure
10421043 $(GIT_TARNAME ) /configure \
10431044 $(GIT_TARNAME ) /version \
10441045 $(GIT_TARNAME ) /git-gui/version
1045- @rm -rf $(GIT_TARNAME )
1046+ @$( RM ) -r $(GIT_TARNAME )
10461047 gzip -f -9 $(GIT_TARNAME ) .tar
10471048
10481049rpm : dist
@@ -1051,13 +1052,13 @@ rpm: dist
10511052htmldocs = git-htmldocs-$(GIT_VERSION )
10521053manpages = git-manpages-$(GIT_VERSION )
10531054dist-doc :
1054- rm -fr .doc-tmp-dir
1055+ $( RM ) -r .doc-tmp-dir
10551056 mkdir .doc-tmp-dir
10561057 $(MAKE ) -C Documentation WEBDOC_DEST=../.doc-tmp-dir install-webdoc
10571058 cd .doc-tmp-dir && $(TAR ) cf ../$(htmldocs ) .tar .
10581059 gzip -n -9 -f $(htmldocs ) .tar
10591060 :
1060- rm -fr .doc-tmp-dir
1061+ $( RM ) -r .doc-tmp-dir
10611062 mkdir -p .doc-tmp-dir/man1 .doc-tmp-dir/man5 .doc-tmp-dir/man7
10621063 $(MAKE ) -C Documentation DESTDIR=./ \
10631064 man1dir=../.doc-tmp-dir/man1 \
@@ -1066,31 +1067,31 @@ dist-doc:
10661067 install
10671068 cd .doc-tmp-dir && $(TAR ) cf ../$(manpages ) .tar .
10681069 gzip -n -9 -f $(manpages ) .tar
1069- rm -fr .doc-tmp-dir
1070+ $( RM ) -r .doc-tmp-dir
10701071
10711072# ## Cleaning rules
10721073
10731074clean :
1074- rm -f * .o mozilla-sha1/* .o arm/* .o ppc/* .o compat/* .o xdiff/* .o \
1075+ $( RM ) * .o mozilla-sha1/* .o arm/* .o ppc/* .o compat/* .o xdiff/* .o \
10751076 $(LIB_FILE ) $(XDIFF_LIB )
1076- rm -f $(ALL_PROGRAMS ) $(BUILT_INS ) git$X
1077- rm -f $(TEST_PROGRAMS )
1078- rm -f * .spec * .pyc * .pyo * /* .pyc * /* .pyo common-cmds.h TAGS tags
1079- rm -rf autom4te.cache
1080- rm -f configure config.log config.mak.autogen config.mak.append config.status config.cache
1081- rm -rf $(GIT_TARNAME ) .doc-tmp-dir
1082- rm -f $(GIT_TARNAME ) .tar.gz git-core_$(GIT_VERSION ) -* .tar.gz
1083- rm -f $(htmldocs ) .tar.gz $(manpages ) .tar.gz
1084- rm -f gitweb/gitweb.cgi
1077+ $( RM ) $(ALL_PROGRAMS ) $(BUILT_INS ) git$X
1078+ $( RM ) $(TEST_PROGRAMS )
1079+ $( RM ) * .spec * .pyc * .pyo * /* .pyc * /* .pyo common-cmds.h TAGS tags
1080+ $( RM ) -r autom4te.cache
1081+ $( RM ) configure config.log config.mak.autogen config.mak.append config.status config.cache
1082+ $( RM ) -r $(GIT_TARNAME ) .doc-tmp-dir
1083+ $( RM ) $(GIT_TARNAME ) .tar.gz git-core_$(GIT_VERSION ) -* .tar.gz
1084+ $( RM ) $(htmldocs ) .tar.gz $(manpages ) .tar.gz
1085+ $( RM ) gitweb/gitweb.cgi
10851086 $(MAKE ) -C Documentation/ clean
10861087 $(MAKE ) -C perl clean
10871088 $(MAKE ) -C templates/ clean
10881089 $(MAKE ) -C t/ clean
10891090ifndef NO_TCLTK
1090- rm -f gitk-wish
1091+ $(RM) gitk-wish
10911092 $(MAKE) -C git-gui clean
10921093endif
1093- rm -f GIT-VERSION-FILE GIT-CFLAGS GIT-GUI-VARS
1094+ $(RM) GIT-VERSION-FILE GIT-CFLAGS GIT-GUI-VARS
10941095
10951096.PHONY : all install clean strip
10961097.PHONY : .FORCE-GIT-VERSION-FILE TAGS tags .FORCE-GIT-CFLAGS
0 commit comments