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