Merge branch 'mk/make-rm-depdirs-could-be-empty'
authorJunio C Hamano <gitster@pobox.com>
Fri, 15 Feb 2013 00:06:24 +0000 (16:06 -0800)
committerJunio C Hamano <gitster@pobox.com>
Fri, 15 Feb 2013 00:06:24 +0000 (16:06 -0800)
"make COMPUTE_HEADER_DEPENDENCIES=no clean" would try to run "rm
-rf $(dep_dirs)" with an empty dep_dir, but some implementations of
"rm -rf" barf on an empty argument list.

* mk/make-rm-depdirs-could-be-empty:
Makefile: don't run "rm" without any files

1  2 
Makefile
diff --combined Makefile
index 951dc7d2d7ea5fcc430c65a183948b53a6166acf,c2e3666155cf17634181f7fbc93eca67540f9b0b..ba8e243425f1d013538fddf9a9552b96812cef4f
+++ b/Makefile
@@@ -43,9 -43,6 +43,9 @@@ all:
  # Define EXPATDIR=/foo/bar if your expat header and library files are in
  # /foo/bar/include and /foo/bar/lib directories.
  #
 +# Define EXPAT_NEEDS_XMLPARSE_H if you have an old version of expat (e.g.,
 +# 1.1 or 1.2) that provides xmlparse.h instead of expat.h.
 +#
  # Define NO_GETTEXT if you don't want Git output to be translated.
  # A translated Git requires GNU libintl or another gettext implementation,
  # plus libintl-perl at runtime.
@@@ -483,38 -480,9 +483,38 @@@ SCRIPT_PERL += git-svn.per
  SCRIPT_PYTHON += git-remote-testpy.py
  SCRIPT_PYTHON += git-p4.py
  
 -SCRIPTS = $(patsubst %.sh,%,$(SCRIPT_SH)) \
 -        $(patsubst %.perl,%,$(SCRIPT_PERL)) \
 -        $(patsubst %.py,%,$(SCRIPT_PYTHON)) \
 +# Generated files for scripts
 +SCRIPT_SH_GEN = $(patsubst %.sh,%,$(SCRIPT_SH))
 +SCRIPT_PERL_GEN = $(patsubst %.perl,%,$(SCRIPT_PERL))
 +SCRIPT_PYTHON_GEN = $(patsubst %.py,%,$(SCRIPT_PYTHON))
 +
 +# Individual rules to allow e.g.
 +# "make -C ../.. SCRIPT_PERL=contrib/foo/bar.perl build-perl-script"
 +# from subdirectories like contrib/*/
 +.PHONY: build-perl-script build-sh-script build-python-script
 +build-perl-script: $(SCRIPT_PERL_GEN)
 +build-sh-script: $(SCRIPT_SH_GEN)
 +build-python-script: $(SCRIPT_PYTHON_GEN)
 +
 +.PHONY: install-perl-script install-sh-script install-python-script
 +install-sh-script: $(SCRIPT_SH_GEN)
 +      $(INSTALL) $(SCRIPT_SH_GEN) '$(DESTDIR_SQ)$(gitexec_instdir_SQ)'
 +install-perl-script: $(SCRIPT_PERL_GEN)
 +      $(INSTALL) $(SCRIPT_PERL_GEN) '$(DESTDIR_SQ)$(gitexec_instdir_SQ)'
 +install-python-script: $(SCRIPT_PYTHON_GEN)
 +      $(INSTALL) $(SCRIPT_PYTHON_GEN) '$(DESTDIR_SQ)$(gitexec_instdir_SQ)'
 +
 +.PHONY: clean-perl-script clean-sh-script clean-python-script
 +clean-sh-script:
 +      $(RM) $(SCRIPT_SH_GEN)
 +clean-perl-script:
 +      $(RM) $(SCRIPT_PERL_GEN)
 +clean-python-script:
 +      $(RM) $(SCRIPT_PYTHON_GEN)
 +
 +SCRIPTS = $(SCRIPT_SH_GEN) \
 +        $(SCRIPT_PERL_GEN) \
 +        $(SCRIPT_PYTHON_GEN) \
          git-instaweb
  
  ETAGS_TARGET = TAGS
@@@ -1121,9 -1089,6 +1121,9 @@@ els
                else
                        EXPAT_LIBEXPAT = -lexpat
                endif
 +              ifdef EXPAT_NEEDS_XMLPARSE_H
 +                      BASIC_CFLAGS += -DEXPAT_NEEDS_XMLPARSE_H
 +              endif
        endif
  endif
  
@@@ -2449,8 -2414,7 +2449,7 @@@ clean: profile-clea
                builtin/*.o $(LIB_FILE) $(XDIFF_LIB) $(VCSSVN_LIB)
        $(RM) $(ALL_PROGRAMS) $(SCRIPT_LIB) $(BUILT_INS) git$X
        $(RM) $(TEST_PROGRAMS)
-       $(RM) -r bin-wrappers
-       $(RM) -r $(dep_dirs)
+       $(RM) -r bin-wrappers $(dep_dirs)
        $(RM) -r po/build/
        $(RM) *.spec *.pyc *.pyo */*.pyc */*.pyo common-cmds.h $(ETAGS_TARGET) tags cscope*
        $(RM) -r $(GIT_TARNAME) .doc-tmp-dir