perl / Makefileon commit Merge branch 'jk/push-delete-ref-error-message' into maint (b120079)
   1#
   2# Makefile for perl support modules and routine
   3#
   4makfile:=perl.mak
   5modules =
   6
   7PERL_PATH_SQ = $(subst ','\'',$(PERL_PATH))
   8prefix_SQ = $(subst ','\'',$(prefix))
   9localedir_SQ = $(subst ','\'',$(localedir))
  10
  11ifndef V
  12        QUIET = @
  13endif
  14
  15all install instlibdir: $(makfile)
  16        $(QUIET)$(MAKE) -f $(makfile) $@
  17
  18clean:
  19        $(QUIET)test -f $(makfile) && $(MAKE) -f $(makfile) $@ || exit 0
  20        $(RM) ppport.h
  21        $(RM) $(makfile)
  22        $(RM) $(makfile).old
  23
  24ifdef NO_PERL_MAKEMAKER
  25instdir_SQ = $(subst ','\'',$(prefix)/lib)
  26
  27modules += Git
  28modules += Git/I18N
  29modules += Git/SVN/Memoize/YAML
  30modules += Git/SVN/Fetcher
  31modules += Git/SVN/Editor
  32modules += Git/SVN/Prompt
  33modules += Git/SVN/Ra
  34
  35$(makfile): ../GIT-CFLAGS Makefile
  36        echo all: private-Error.pm Git.pm Git/I18N.pm > $@
  37        echo '  mkdir -p blib/lib/Git/SVN/Memoize' >> $@
  38        set -e; \
  39        for i in $(modules); \
  40        do \
  41                echo '  $(RM) blib/lib/'$$i'.pm' >> $@; \
  42                echo '  cp '$$i'.pm blib/lib/'$$i'.pm' >> $@; \
  43        done
  44        echo '  $(RM) blib/lib/Error.pm' >> $@
  45        '$(PERL_PATH_SQ)' -MError -e 'exit($$Error::VERSION < 0.15009)' || \
  46        echo '  cp private-Error.pm blib/lib/Error.pm' >> $@
  47        echo install: >> $@
  48        echo '  mkdir -p "$$(DESTDIR)$(instdir_SQ)/Git/SVN/Memoize"' >> $@
  49        set -e; \
  50        for i in $(modules); \
  51        do \
  52                echo '  $(RM) "$$(DESTDIR)$(instdir_SQ)/'$$i'.pm"' >> $@; \
  53                echo '  cp '$$i'.pm "$$(DESTDIR)$(instdir_SQ)/'$$i'.pm"' >> $@; \
  54        done
  55        echo '  $(RM) "$$(DESTDIR)$(instdir_SQ)/Error.pm"' >> $@
  56        '$(PERL_PATH_SQ)' -MError -e 'exit($$Error::VERSION < 0.15009)' || \
  57        echo '  cp private-Error.pm "$$(DESTDIR)$(instdir_SQ)/Error.pm"' >> $@
  58        echo instlibdir: >> $@
  59        echo '  echo $(instdir_SQ)' >> $@
  60else
  61$(makfile): Makefile.PL ../GIT-CFLAGS
  62        $(PERL_PATH) $< PREFIX='$(prefix_SQ)' INSTALL_BASE='' --localedir='$(localedir_SQ)'
  63endif
  64
  65# this is just added comfort for calling make directly in perl dir
  66# (even though GIT-CFLAGS aren't used yet. If ever)
  67../GIT-CFLAGS:
  68        $(MAKE) -C .. GIT-CFLAGS