77#
88#
99# IDENTIFICATION
10- # $Header: /cvsroot/pgsql/src/interfaces/Makefile,v 1.18 1998/10/16 15:31:04 momjian Exp $
10+ # $Header: /cvsroot/pgsql/src/interfaces/Makefile,v 1.19 1998/10/18 02:33:56 tgl Exp $
1111#
1212# -------------------------------------------------------------------------
1313
1414SRCDIR = ..
1515include $(SRCDIR ) /Makefile.global
1616
1717
18- PERL_CLEAN := DO_NOTHING
18+ # Note: the klugery for perl5 is to ensure that the perl5 shared lib
19+ # gets built with the correct path to the installed location of libpq
20+ # during "make install", but is built against the local tree during
21+ # ordinary building and testing.
1922
2023.DEFAULT all install clean dep depend distclean :
2124$(MAKE ) -C libpq$@
@@ -29,13 +32,24 @@ ifeq ($(USE_TCL), true)
2932$(MAKE) -C libpgtcl $@
3033endif
3134ifeq ($(USE_PERL ) , true)
32- -$(MAKE) -C perl5 $(PERL_CLEAN)
33- $(MAKE) perl5/Makefile
34- $(MAKE) -C perl5 $@
35+ if [ "$@" = "install" ]; then \
36+ $(MAKE) $(MFLAGS) install-perl5; \
37+ else \
38+ $(MAKE) $(MFLAGS) perl5/Makefile; \
39+ $(MAKE) $(MFLAGS) -C perl5 $@; \
40+ fi
3541endif
3642ifeq ($(USE_ODBC ) , true)
3743$(MAKE) -C odbc $@
3844endif
3945
4046perl5/Makefile : perl5/Makefile.PL
4147cd perl5&& perl Makefile.PL
48+
49+ install-perl5 :
50+ $(MAKE ) -C perl5 clean
51+ cd perl5&& POSTGRES_HOME=" $( POSTGRESDIR) " perl Makefile.PL
52+ $(MAKE ) -C perl5 install
53+ rm -f perl5/Makefile
54+
55+ .PHONY : install-perl5