summaryrefslogtreecommitdiff
path: root/perl/Makefile
blob: b2977cd0bc8f23d75a228ca13d6cb42e1c72628f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#
# Makefile for perl support modules and routine
#
makfile:=perl.mak

PERL_PATH_SQ = $(subst ','\'',$(PERL_PATH))
prefix_SQ = $(subst ','\'',$(prefix))
localedir_SQ = $(subst ','\'',$(localedir))

ifndef V
	QUIET = @
endif

all install instlibdir: $(makfile)
	$(QUIET)$(MAKE) -f $(makfile) $@

clean:
	$(QUIET)test -f $(makfile) && $(MAKE) -f $(makfile) $@ || exit 0
	$(RM) ppport.h
	$(RM) $(makfile)
	$(RM) $(makfile).old

ifdef NO_PERL_MAKEMAKER
instdir_SQ = $(subst ','\'',$(prefix)/lib)
$(makfile): ../GIT-CFLAGS Makefile
	echo all: private-Error.pm Git.pm > $@
	echo '	mkdir -p blib/lib' >> $@
	echo '	$(RM) blib/lib/Git.pm; cp Git.pm blib/lib/' >> $@
	echo '	$(RM) blib/lib/Error.pm' >> $@
	'$(PERL_PATH_SQ)' -MError -e 'exit($$Error::VERSION < 0.15009)' || \
	echo '	cp private-Error.pm blib/lib/Error.pm' >> $@
	echo install: >> $@
	echo '	mkdir -p "$$(DESTDIR)$(instdir_SQ)"' >> $@
	echo '	$(RM) "$$(DESTDIR)$(instdir_SQ)/Git.pm"; cp Git.pm "$$(DESTDIR)$(instdir_SQ)"' >> $@
	echo '	$(RM) "$$(DESTDIR)$(instdir_SQ)/Error.pm"' >> $@
	'$(PERL_PATH_SQ)' -MError -e 'exit($$Error::VERSION < 0.15009)' || \
	echo '	cp private-Error.pm "$$(DESTDIR)$(instdir_SQ)/Error.pm"' >> $@
	echo instlibdir: >> $@
	echo '	echo $(instdir_SQ)' >> $@
else
$(makfile): Makefile.PL ../GIT-CFLAGS
	$(PERL_PATH) $< PREFIX='$(prefix_SQ)' INSTALL_BASE='' --localedir='$(localedir_SQ)'
endif

# this is just added comfort for calling make directly in perl dir
# (even though GIT-CFLAGS aren't used yet. If ever)
../GIT-CFLAGS:
	$(MAKE) -C .. GIT-CFLAGS