|
|
@ -4,64 +4,92 @@ |
|
|
|
# Makefile according to its own ideas and then invoke the rules from
|
|
|
|
# Makefile according to its own ideas and then invoke the rules from
|
|
|
|
# that file.
|
|
|
|
# that file.
|
|
|
|
#
|
|
|
|
#
|
|
|
|
# $Header: /cvsroot/pgsql/src/interfaces/perl5/Attic/GNUmakefile,v 1.5 2000/11/17 00:08:57 tgl Exp $
|
|
|
|
# $Header: /cvsroot/pgsql/src/interfaces/perl5/Attic/GNUmakefile,v 1.6 2001/08/26 22:28:04 petere Exp $
|
|
|
|
|
|
|
|
|
|
|
|
subdir = src/interfaces/perl5
|
|
|
|
subdir = src/interfaces/perl5
|
|
|
|
top_builddir = ../../..
|
|
|
|
top_builddir = ../../..
|
|
|
|
include $(top_builddir)/src/Makefile.global |
|
|
|
include $(top_builddir)/src/Makefile.global |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
.NOTPARALLEL: |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# This would allow a non-root install of the Perl module, but it's not
|
|
|
|
|
|
|
|
# quite implemented yet.
|
|
|
|
|
|
|
|
ifeq ($(mysterious_feature),yes) |
|
|
|
|
|
|
|
perl_installsitearch = $(pkglibdir)
|
|
|
|
|
|
|
|
perl_installsitelib = $(pkglibdir)
|
|
|
|
|
|
|
|
perl_installman3dir = $(mandir)/man3
|
|
|
|
|
|
|
|
endif |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
all: Makefile libpq-all |
|
|
|
all: Makefile libpq-all |
|
|
|
$(MAKE) -f $< all
|
|
|
|
$(MAKE) -f $< all VPATH=$(VPATH)
|
|
|
|
|
|
|
|
|
|
|
|
Makefile: Makefile.PL |
|
|
|
# We need to run Makefile.PL in the source directory because it scans
|
|
|
|
$(PERL) $<
|
|
|
|
# the directory for files to build with. If we ran it in the build
|
|
|
|
|
|
|
|
# dir it would miss all the files and not build half the stuff!
|
|
|
|
|
|
|
|
Makefile: Makefile.PL Pg.pm |
|
|
|
|
|
|
|
abs_builddir=`pwd`; \
|
|
|
|
|
|
|
|
abs_libpq_builddir=`cd $(libpq_builddir) && pwd`; \
|
|
|
|
|
|
|
|
cd $(srcdir) && \
|
|
|
|
|
|
|
|
SRCDIR=$(srcdir) \
|
|
|
|
|
|
|
|
PGLIBDIR=$(libdir) \
|
|
|
|
|
|
|
|
$(PERL) $< \
|
|
|
|
|
|
|
|
INC='-I$(srcdir) -I$(libpq_srcdir) $(filter -I%, $(CPPFLAGS))' \
|
|
|
|
|
|
|
|
LIBS="-L$$abs_libpq_builddir -lpq" \
|
|
|
|
|
|
|
|
INSTALLSITEARCH='$$(DESTDIR)$(perl_installsitearch)' \
|
|
|
|
|
|
|
|
INSTALLSITELIB='$$(DESTDIR)$(perl_installsitelib)' \
|
|
|
|
|
|
|
|
INSTALLMAN3DIR='$$(DESTDIR)$(perl_installman3dir)' \
|
|
|
|
|
|
|
|
MAKEFILE="$$abs_builddir/Makefile"
|
|
|
|
|
|
|
|
|
|
|
|
.PHONY: libpq-all |
|
|
|
.PHONY: libpq-all |
|
|
|
libpq-all: |
|
|
|
libpq-all: |
|
|
|
$(MAKE) -C $(libpq_builddir) all
|
|
|
|
$(MAKE) -C $(libpq_builddir) all
|
|
|
|
|
|
|
|
|
|
|
|
test: Makefile |
|
|
|
|
|
|
|
$(MAKE) -f $< test
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# The klugery here is to ensure that the perl5 shared library gets
|
|
|
|
# During install, we must guard against the likelihood that we don't
|
|
|
|
# built with the correct path to the installed location of libpq
|
|
|
|
# have permissions to install into the Perl module library. It's not
|
|
|
|
# during `make install', but is built against the local tree during
|
|
|
|
# exactly fun to have to scan the build output, but...
|
|
|
|
# ordinary building and testing.
|
|
|
|
|
|
|
|
#
|
|
|
|
install-warning-msg := { \
|
|
|
|
# During install, we must also guard against the likelihood that we
|
|
|
|
echo ""; \ |
|
|
|
# don't have permissions to install into the Perl module library. The
|
|
|
|
echo "*** Skipping the installation of the Perl module for lack"; \ |
|
|
|
# purer alternative would naturally be the ability to select the
|
|
|
|
echo "*** of permissions. To install it, change to the directory"; \ |
|
|
|
# installation directory somewhere.
|
|
|
|
echo "*** `pwd`,"; \ |
|
|
|
|
|
|
|
echo "*** become the appropriate user, and enter '$(MAKE) install'."; \ |
|
|
|
install: Makefile |
|
|
|
echo ""; } |
|
|
|
$(MAKE) -f Makefile clean
|
|
|
|
|
|
|
|
POSTGRES_LIB="$(libdir)" \
|
|
|
|
# We need to massage the packlist after installation to get the
|
|
|
|
POSTGRES_INCLUDE="$(includedir)" \
|
|
|
|
# DESTDIR out of there.
|
|
|
|
$(PERL) $(srcdir)/Makefile.PL
|
|
|
|
install: all installdirs |
|
|
|
$(MAKE) -f Makefile all
|
|
|
|
@if test -w $(DESTDIR)$(perl_installsitearch); then \
|
|
|
|
-@if [ -w "`$(MAKE) --quiet -f Makefile echo-installdir`" ]; then \
|
|
|
|
$(MAKE) -f Makefile pure_install DESTDIR=$(DESTDIR) && \
|
|
|
|
$(MAKE) -f Makefile install; \
|
|
|
|
mv $(DESTDIR)$(perl_installsitearch)/auto/Pg/.packlist fake-packlist && \
|
|
|
|
$(MAKE) clean; \
|
|
|
|
sed 's,^$(DESTDIR),,' fake-packlist >$(DESTDIR)$(perl_installsitearch)/auto/Pg/.packlist && \
|
|
|
|
|
|
|
|
rm fake-packlist; \
|
|
|
|
else \
|
|
|
|
else \
|
|
|
|
echo "*****" ;\
|
|
|
|
$(install-warning-msg); \
|
|
|
|
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
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# Try to make the directories ourselves, otherwise the writability
|
|
|
|
|
|
|
|
# test above may fail because of mere non-existence.
|
|
|
|
|
|
|
|
installdirs: |
|
|
|
|
|
|
|
-$(mkinstalldirs) $(DESTDIR)$(perl_installsitearch)/auto/Pg \
|
|
|
|
|
|
|
|
$(DESTDIR)$(perl_installsitelib) \
|
|
|
|
|
|
|
|
$(DESTDIR)$(perl_installman3dir)
|
|
|
|
|
|
|
|
|
|
|
|
uninstall: |
|
|
|
uninstall: |
|
|
|
@echo "*****"; \
|
|
|
|
for file in `cat $(DESTDIR)$(perl_installsitearch)/auto/Pg/.packlist`; do \
|
|
|
|
echo "* The Perl module cannot be uninstalled automatically. You can"; \
|
|
|
|
rm -f $(DESTDIR)$$file || exit; \
|
|
|
|
echo "* change into the directory "`pwd`" and do"; \
|
|
|
|
done
|
|
|
|
echo "*"; \
|
|
|
|
rm -f $(DESTDIR)$(perl_installsitearch)/auto/Pg/.packlist
|
|
|
|
echo "* $(MAKE) -f Makefile realclean"; \
|
|
|
|
-rmdir $(DESTDIR)$(perl_installsitearch)/auto/Pg
|
|
|
|
echo "*"; \
|
|
|
|
|
|
|
|
echo "* to delete built and installed files."; \
|
|
|
|
|
|
|
|
echo "*****"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
clean distclean maintainer-clean: |
|
|
|
clean distclean maintainer-clean: |
|
|
|
-[ -f Makefile ] && $(MAKE) -f Makefile clean
|
|
|
|
-[ -f Makefile ] && $(MAKE) -f Makefile clean
|
|
|
|
rm -f Makefile Makefile.old
|
|
|
|
rm -f Makefile Makefile.old
|
|
|
|
|
|
|
|
@rm -f fake-packlist
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
installcheck test: Makefile |
|
|
|
|
|
|
|
$(MAKE) -f $< test
|
|
|
|