perl / Makefileon commit status: don't suggest "git rm" or "git add" if not appropriate (96b0ec1)
   1#
   2# Makefile for perl support modules and routine
   3#
   4makfile:=perl.mak
   5
   6PERL_PATH_SQ = $(subst ','\'',$(PERL_PATH))
   7prefix_SQ = $(subst ','\'',$(prefix))
   8localedir_SQ = $(subst ','\'',$(localedir))
   9
  10ifndef V
  11        QUIET = @
  12endif
  13
  14all install instlibdir: $(makfile)
  15        $(QUIET)$(MAKE) -f $(makfile) $@
  16
  17clean:
  18        $(QUIET)test -f $(makfile) && $(MAKE) -f $(makfile) $@ || exit 0
  19        $(RM) ppport.h
  20        $(RM) $(makfile)
  21        $(RM) $(makfile).old
  22
  23ifdef NO_PERL_MAKEMAKER
  24instdir_SQ = $(subst ','\'',$(prefix)/lib)
  25$(makfile): ../GIT-CFLAGS Makefile
  26        echo all: private-Error.pm Git.pm Git/I18N.pm > $@
  27        echo '  mkdir -p blib/lib/Git' >> $@
  28        echo '  $(RM) blib/lib/Git.pm; cp Git.pm blib/lib/' >> $@
  29        echo '  $(RM) blib/lib/Git/I18N.pm; cp Git/I18N.pm blib/lib/Git/' >> $@
  30        echo '  $(RM) blib/lib/Error.pm' >> $@
  31        '$(PERL_PATH_SQ)' -MError -e 'exit($$Error::VERSION < 0.15009)' || \
  32        echo '  cp private-Error.pm blib/lib/Error.pm' >> $@
  33        echo install: >> $@
  34        echo '  mkdir -p "$$(DESTDIR)$(instdir_SQ)"' >> $@
  35        echo '  mkdir -p "$$(DESTDIR)$(instdir_SQ)/Git"' >> $@
  36        echo '  $(RM) "$$(DESTDIR)$(instdir_SQ)/Git.pm"; cp Git.pm "$$(DESTDIR)$(instdir_SQ)"' >> $@
  37        echo '  $(RM) "$$(DESTDIR)$(instdir_SQ)/Git/I18N.pm"; cp Git/I18N.pm "$$(DESTDIR)$(instdir_SQ)/Git"' >> $@
  38        echo '  $(RM) "$$(DESTDIR)$(instdir_SQ)/Error.pm"' >> $@
  39        '$(PERL_PATH_SQ)' -MError -e 'exit($$Error::VERSION < 0.15009)' || \
  40        echo '  cp private-Error.pm "$$(DESTDIR)$(instdir_SQ)/Error.pm"' >> $@
  41        echo instlibdir: >> $@
  42        echo '  echo $(instdir_SQ)' >> $@
  43else
  44$(makfile): Makefile.PL ../GIT-CFLAGS
  45        $(PERL_PATH) $< PREFIX='$(prefix_SQ)' INSTALL_BASE='' --localedir='$(localedir_SQ)'
  46endif
  47
  48# this is just added comfort for calling make directly in perl dir
  49# (even though GIT-CFLAGS aren't used yet. If ever)
  50../GIT-CFLAGS:
  51        $(MAKE) -C .. GIT-CFLAGS