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