perl / Makefileon commit Extract Git::SVN from git-svn into its own .pm file. (29499c0)
   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        $(RM) PM.stamp
  24
  25$(makfile): PM.stamp
  26
  27ifdef NO_PERL_MAKEMAKER
  28instdir_SQ = $(subst ','\'',$(prefix)/lib)
  29
  30modules += Git
  31modules += Git/I18N
  32modules += Git/SVN
  33modules += Git/SVN/Memoize/YAML
  34modules += Git/SVN/Fetcher
  35modules += Git/SVN/Editor
  36modules += Git/SVN/Prompt
  37modules += Git/SVN/Ra
  38modules += Git/SVN/Utils
  39
  40$(makfile): ../GIT-CFLAGS Makefile
  41        echo all: private-Error.pm Git.pm Git/I18N.pm > $@
  42        set -e; \
  43        for i in $(modules); \
  44        do \
  45                if test $$i = $${i%/*}; \
  46                then \
  47                        subdir=; \
  48                else \
  49                        subdir=/$${i%/*}; \
  50                fi; \
  51                echo '  $(RM) blib/lib/'$$i'.pm' >> $@; \
  52                echo '  mkdir -p blib/lib'$$subdir >> $@; \
  53                echo '  cp '$$i'.pm blib/lib/'$$i'.pm' >> $@; \
  54        done
  55        echo '  $(RM) blib/lib/Error.pm' >> $@
  56        '$(PERL_PATH_SQ)' -MError -e 'exit($$Error::VERSION < 0.15009)' || \
  57        echo '  cp private-Error.pm blib/lib/Error.pm' >> $@
  58        echo install: >> $@
  59        set -e; \
  60        for i in $(modules); \
  61        do \
  62                if test $$i = $${i%/*}; \
  63                then \
  64                        subdir=; \
  65                else \
  66                        subdir=/$${i%/*}; \
  67                fi; \
  68                echo '  $(RM) "$$(DESTDIR)$(instdir_SQ)/'$$i'.pm"' >> $@; \
  69                echo '  mkdir -p "$$(DESTDIR)$(instdir_SQ)'$$subdir'"' >> $@; \
  70                echo '  cp '$$i'.pm "$$(DESTDIR)$(instdir_SQ)/'$$i'.pm"' >> $@; \
  71        done
  72        echo '  $(RM) "$$(DESTDIR)$(instdir_SQ)/Error.pm"' >> $@
  73        '$(PERL_PATH_SQ)' -MError -e 'exit($$Error::VERSION < 0.15009)' || \
  74        echo '  cp private-Error.pm "$$(DESTDIR)$(instdir_SQ)/Error.pm"' >> $@
  75        echo instlibdir: >> $@
  76        echo '  echo $(instdir_SQ)' >> $@
  77else
  78$(makfile): Makefile.PL ../GIT-CFLAGS
  79        $(PERL_PATH) $< PREFIX='$(prefix_SQ)' INSTALL_BASE='' --localedir='$(localedir_SQ)'
  80endif
  81
  82# this is just added comfort for calling make directly in perl dir
  83# (even though GIT-CFLAGS aren't used yet. If ever)
  84../GIT-CFLAGS:
  85        $(MAKE) -C .. GIT-CFLAGS