blob: a2ffb6402d45420dff4dcd545dfa08b57305d8cd [file] [log] [blame]
Alex Riesenf8487182006-12-04 10:50:04 +01001#
2# Makefile for perl support modules and routine
3#
4makfile:=perl.mak
5
6PERL_PATH_SQ = $(subst ','\'',$(PERL_PATH))
7prefix_SQ = $(subst ','\'',$(prefix))
8
Shawn O. Pearce2314c942007-03-06 02:09:14 -05009ifndef V
Shawn O. Pearce74f2b2a2007-03-06 01:35:01 -050010 QUIET = @
11endif
12
Alex Riesenf8487182006-12-04 10:50:04 +010013all install instlibdir: $(makfile)
Shawn O. Pearce74f2b2a2007-03-06 01:35:01 -050014 $(QUIET)$(MAKE) -f $(makfile) $@
Alex Riesenf8487182006-12-04 10:50:04 +010015
16clean:
Shawn O. Pearce74f2b2a2007-03-06 01:35:01 -050017 $(QUIET)test -f $(makfile) && $(MAKE) -f $(makfile) $@ || exit 0
Alex Riesenf8487182006-12-04 10:50:04 +010018 $(RM) ppport.h
19 $(RM) $(makfile)
20 $(RM) $(makfile).old
21
22ifdef NO_PERL_MAKEMAKER
23instdir_SQ = $(subst ','\'',$(prefix)/lib)
24$(makfile): ../GIT-CFLAGS Makefile
Brandon Casey058fb412008-07-22 16:15:41 -050025 echo all: private-Error.pm Git.pm > $@
26 echo ' mkdir -p blib/lib' >> $@
27 echo ' $(RM) blib/lib/Git.pm; cp Git.pm blib/lib/' >> $@
28 echo ' $(RM) blib/lib/Error.pm' >> $@
29 '$(PERL_PATH_SQ)' -MError -e 'exit($$Error::VERSION < 0.15009)' || \
30 echo ' cp private-Error.pm blib/lib/Error.pm' >> $@
Alex Riesenf8487182006-12-04 10:50:04 +010031 echo install: >> $@
Junio C Hamano3696c4c2009-09-21 12:44:05 -070032 echo ' mkdir -p "$$(DESTDIR)$(instdir_SQ)"' >> $@
33 echo ' $(RM) "$$(DESTDIR)$(instdir_SQ)/Git.pm"; cp Git.pm "$$(DESTDIR)$(instdir_SQ)"' >> $@
34 echo ' $(RM) "$$(DESTDIR)$(instdir_SQ)/Error.pm"' >> $@
Brandon Casey058fb412008-07-22 16:15:41 -050035 '$(PERL_PATH_SQ)' -MError -e 'exit($$Error::VERSION < 0.15009)' || \
Junio C Hamano3696c4c2009-09-21 12:44:05 -070036 echo ' cp private-Error.pm "$$(DESTDIR)$(instdir_SQ)/Error.pm"' >> $@
Alex Riesenf8487182006-12-04 10:50:04 +010037 echo instlibdir: >> $@
38 echo ' echo $(instdir_SQ)' >> $@
39else
40$(makfile): Makefile.PL ../GIT-CFLAGS
Ævar Arnfjörð Bjarmasonfa57f712010-08-03 10:30:11 +000041 $(PERL_PATH) $< PREFIX='$(prefix_SQ)' INSTALL_BASE=''
Alex Riesenf8487182006-12-04 10:50:04 +010042endif
43
44# this is just added comfort for calling make directly in perl dir
45# (even though GIT-CFLAGS aren't used yet. If ever)
46../GIT-CFLAGS:
47 $(MAKE) -C .. GIT-CFLAGS