aboutsummaryrefslogtreecommitdiff
path: root/src/interfaces/perl5/GNUmakefile.in
blob: 29bd818ee6604580d468dc5d04cdcf047b23d84b (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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
# This file is an interface from the Autoconf world to Perl's
# MakeMaker world, so that the latter behaves (kind of) like the
# former would prefer. Internally, we call Perl to create another
# Makefile according to it's own ideas and then invoke the rules from
# that file.
#
# $Header: /cvsroot/pgsql/src/interfaces/perl5/Attic/GNUmakefile.in,v 1.1 2000/06/10 18:01:56 petere Exp $

srcdir = @srcdir@
VPATH = @srcdir@

top_srcdir = @top_srcdir@
top_builddir = ../../..

PERL = @PERL@

prefix = @prefix@
exec_prefix = @exec_prefix@
libdir = @libdir@
includedir = @includedir@


all: Makefile libpq-all
	$(MAKE) -f $< all

Makefile: Makefile.PL
	$(PERL) $< POLLUTE=1

libpq-all:
	$(MAKE) -C $(top_builddir)/src/interfaces/libpq all

# The klugery here is to ensure that the perl5 shared library gets
# built with the correct path to the installed location of libpq
# during `make install', but is built against the local tree during
# ordinary building and testing.
#
# During install, we must also guard against the likelihood that we
# don't have permissions to install into the Perl module library. The
# purer alternative would naturally be the ability to select the
# installation directory somewhere.

install: Makefile libpq-install
	$(MAKE) -f Makefile clean
	POSTGRES_LIB="$(libdir)" \
	  POSTGRES_INCLUDE="$(includedir)" \
	  $(PERL) $(srcdir)/Makefile.PL POLLUTE=1
	$(MAKE) -f Makefile all
	-@if [ -w "`$(MAKE) --quiet -f Makefile echo-installdir`" ]; then \
		$(MAKE) -f Makefile install; \
		rm -f Makefile; \
	else \
		echo "*****" ;\
		echo "* Skipping the installation of the Perl module for lack of permissions."; \
		echo "* To install it, change to the directory "`pwd`","; \
		echo "* become the appropriate user, and do \`$(MAKE) install'."; \
		echo "*****"; \
	fi

libpq-install:
	$(MAKE) -C $(top_builddir)/src/interfaces/libpq install

# Note: Perl's idea of "clean" is a little different, so we use "realclean"

clean:
	-[ -f Makefile ] && $(MAKE) -f Makefile realclean

distclean maintainer-clean: clean
	rm -f GNUmakefile


.PHONY: all install clean distclean maintainer-clean libpq-all libpq-install