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