1998-09-25 17:50:02 +02:00
|
|
|
#-------------------------------------------------------------------------
|
|
|
|
#
|
2000-06-20 18:40:19 +02:00
|
|
|
# Makefile for the plpgsql shared object
|
1998-09-25 17:50:02 +02:00
|
|
|
#
|
2000-10-23 23:44:12 +02:00
|
|
|
# $Header: /cvsroot/pgsql/src/pl/plpgsql/src/Makefile,v 1.9 2000/10/23 21:44:03 petere Exp $
|
1998-09-25 17:50:02 +02:00
|
|
|
#
|
|
|
|
#-------------------------------------------------------------------------
|
|
|
|
|
2000-06-20 18:40:19 +02:00
|
|
|
subdir = src/pl/plpgsql/src
|
2000-06-27 02:32:06 +02:00
|
|
|
top_builddir = ../../../..
|
|
|
|
include $(top_builddir)/src/Makefile.global
|
2000-06-20 18:40:19 +02:00
|
|
|
|
|
|
|
# Shared library parameters
|
1998-10-19 02:00:51 +02:00
|
|
|
NAME= plpgsql
|
|
|
|
SO_MAJOR_VERSION= 1
|
|
|
|
SO_MINOR_VERSION= 0
|
2000-06-20 18:40:19 +02:00
|
|
|
|
2000-10-20 23:04:27 +02:00
|
|
|
override CPPFLAGS += -I$(srcdir)
|
1998-09-25 17:50:02 +02:00
|
|
|
|
2000-06-27 02:32:06 +02:00
|
|
|
OBJS = pl_parse.o pl_handler.o pl_comp.o pl_exec.o pl_funcs.o
|
1998-10-09 18:57:10 +02:00
|
|
|
|
2000-06-28 20:30:16 +02:00
|
|
|
all: all-lib
|
|
|
|
|
|
|
|
# Shared library stuff
|
2000-06-27 02:32:06 +02:00
|
|
|
include $(top_srcdir)/src/Makefile.shlib
|
1998-09-25 17:50:02 +02:00
|
|
|
|
|
|
|
|
2000-06-20 18:40:19 +02:00
|
|
|
# In order to use Makefile.shlib, we allow it to build a static
|
|
|
|
# library libplpgsql.a, which we just ignore, as well as a shared
|
|
|
|
# library that it will insist on naming $(shlib). We don't want to
|
|
|
|
# call it that when installed, however, so we ignore the install-shlib
|
|
|
|
# rule and do this instead:
|
1998-09-25 17:50:02 +02:00
|
|
|
|
2000-06-27 02:32:06 +02:00
|
|
|
install: installdirs all
|
2000-10-23 23:44:12 +02:00
|
|
|
ifeq ($(enable_shared), yes)
|
Support for DESTDIR make variable. This is used as in `make install
DESTDIR=/else/where' and prepends the value of DESTDIR to the full
installation paths (e.g., /else/where/usr/local/pgsql/bin). This allows
users to install the package into a location different from the one that
was configured and hard-coded into various scripts, e.g., for creating
binary packages.
DESTDIR is in many cases preferrable over `make install
prefix=/else/where' because
a) `prefix' affects the path that is hard-coded into the files, which can
lead to a `make install prefix=xxx' (as done by the regression test
driver) corrupting the files in the source tree with wrong paths.
b) it doesn't work at all if a directory was overridden to not depend on
`prefix', e.g., --sysconfdir=/etc.
(Updating the regression test driver to use DESTDIR is a separate
undertaking.)
See also autoconf@gnu.org, From: Akim Demaille <akim@epita.fr>, Date: 08
Sep 2000 12:48:59 +0200, Message-ID:
<mv4em2vb1lw.fsf@nostromo.lrde.epita.fr>, Subject: Re: HTML format
documentation.
2000-09-17 15:02:52 +02:00
|
|
|
$(INSTALL_SHLIB) $(shlib) $(DESTDIR)$(libdir)/plpgsql$(DLSUFFIX)
|
1998-10-30 16:05:23 +01:00
|
|
|
else
|
2000-06-20 18:40:19 +02:00
|
|
|
@echo "*****"; \
|
|
|
|
echo "* PL/pgSQL was not installed due to lack of shared library support."; \
|
|
|
|
echo "*****"
|
1998-10-30 16:05:23 +01:00
|
|
|
endif
|
1998-09-25 17:50:02 +02:00
|
|
|
|
2000-06-20 18:40:19 +02:00
|
|
|
installdirs:
|
Support for DESTDIR make variable. This is used as in `make install
DESTDIR=/else/where' and prepends the value of DESTDIR to the full
installation paths (e.g., /else/where/usr/local/pgsql/bin). This allows
users to install the package into a location different from the one that
was configured and hard-coded into various scripts, e.g., for creating
binary packages.
DESTDIR is in many cases preferrable over `make install
prefix=/else/where' because
a) `prefix' affects the path that is hard-coded into the files, which can
lead to a `make install prefix=xxx' (as done by the regression test
driver) corrupting the files in the source tree with wrong paths.
b) it doesn't work at all if a directory was overridden to not depend on
`prefix', e.g., --sysconfdir=/etc.
(Updating the regression test driver to use DESTDIR is a separate
undertaking.)
See also autoconf@gnu.org, From: Akim Demaille <akim@epita.fr>, Date: 08
Sep 2000 12:48:59 +0200, Message-ID:
<mv4em2vb1lw.fsf@nostromo.lrde.epita.fr>, Subject: Re: HTML format
documentation.
2000-09-17 15:02:52 +02:00
|
|
|
$(mkinstalldirs) $(DESTDIR)$(libdir)
|
1998-09-25 17:50:02 +02:00
|
|
|
|
2000-06-27 02:32:06 +02:00
|
|
|
uninstall:
|
Support for DESTDIR make variable. This is used as in `make install
DESTDIR=/else/where' and prepends the value of DESTDIR to the full
installation paths (e.g., /else/where/usr/local/pgsql/bin). This allows
users to install the package into a location different from the one that
was configured and hard-coded into various scripts, e.g., for creating
binary packages.
DESTDIR is in many cases preferrable over `make install
prefix=/else/where' because
a) `prefix' affects the path that is hard-coded into the files, which can
lead to a `make install prefix=xxx' (as done by the regression test
driver) corrupting the files in the source tree with wrong paths.
b) it doesn't work at all if a directory was overridden to not depend on
`prefix', e.g., --sysconfdir=/etc.
(Updating the regression test driver to use DESTDIR is a separate
undertaking.)
See also autoconf@gnu.org, From: Akim Demaille <akim@epita.fr>, Date: 08
Sep 2000 12:48:59 +0200, Message-ID:
<mv4em2vb1lw.fsf@nostromo.lrde.epita.fr>, Subject: Re: HTML format
documentation.
2000-09-17 15:02:52 +02:00
|
|
|
rm -f $(DESTDIR)$(libdir)/plpgsql$(DLSUFFIX)
|
1998-09-25 17:50:02 +02:00
|
|
|
|
2000-06-27 02:32:06 +02:00
|
|
|
pl_handler.o pl_comp.o pl_exec.o pl_funcs.o: plpgsql.h $(srcdir)/pl.tab.h
|
|
|
|
|
|
|
|
pl_parse.o: $(srcdir)/pl_gram.c $(srcdir)/pl_scan.c plpgsql.h
|
2000-06-20 18:40:19 +02:00
|
|
|
$(CC) -c $(CPPFLAGS) $(CFLAGS) -o $@ $<
|
1998-09-25 17:50:02 +02:00
|
|
|
|
2000-06-20 18:40:19 +02:00
|
|
|
# Note: Since the yacc and lex files are shipped in the distribution,
|
|
|
|
# they must be generated in the srcdir (as opposed to builddir).
|
1998-09-25 17:50:02 +02:00
|
|
|
|
2000-06-20 18:40:19 +02:00
|
|
|
$(srcdir)/pl_gram.c $(srcdir)/pl.tab.h: gram.y
|
2000-06-07 18:27:00 +02:00
|
|
|
$(YACC) -d $(YFLAGS) $<
|
2000-06-20 18:40:19 +02:00
|
|
|
sed -e 's/yy/plpgsql_yy/g' -e 's/YY/PLPGSQL_YY/g' < y.tab.c > $(srcdir)/pl_gram.c
|
|
|
|
sed -e 's/yy/plpgsql_yy/g' -e 's/YY/PLPGSQL_YY/g' < y.tab.h > $(srcdir)/pl.tab.h
|
1999-03-20 19:00:38 +01:00
|
|
|
rm -f y.tab.c y.tab.h
|
1998-09-25 17:50:02 +02:00
|
|
|
|
2000-06-20 18:40:19 +02:00
|
|
|
$(srcdir)/pl_scan.c: scan.l
|
2000-08-28 13:53:23 +02:00
|
|
|
ifdef FLEX
|
|
|
|
$(FLEX) -i -l $(FLEXFLAGS) $<
|
2000-06-20 18:40:19 +02:00
|
|
|
sed -e 's/yy/plpgsql_yy/g' -e 's/YY/PLPGSQL_YY/g' < lex.yy.c > $@
|
1999-03-20 19:00:38 +01:00
|
|
|
rm -f lex.yy.c
|
2000-08-28 13:53:23 +02:00
|
|
|
else
|
|
|
|
@$(missing) flex $< $@
|
|
|
|
endif
|
2000-07-19 18:30:27 +02:00
|
|
|
|
|
|
|
distprep: $(srcdir)/pl_scan.c $(srcdir)/pl.tab.h $(srcdir)/pl_gram.c
|
|
|
|
|
2000-06-20 18:40:19 +02:00
|
|
|
mklang.sql: mklang.sql.in
|
|
|
|
sed -e 's%__libdir__%$(libdir)%g' -e 's%__DLSUFFIX__%$(DLSUFFIX)%g' < $< > $@
|
1998-10-19 02:00:51 +02:00
|
|
|
|
|
|
|
|
2000-06-28 20:30:16 +02:00
|
|
|
clean distclean: clean-lib
|
2000-08-28 13:53:23 +02:00
|
|
|
rm -f $(OBJS) mklang.sql
|
|
|
|
@rm -f y.tab.c y.tab.h lex.yy.c
|
2000-06-20 18:40:19 +02:00
|
|
|
|
|
|
|
maintainer-clean: clean
|
|
|
|
rm -f $(srcdir)/pl_gram.c $(srcdir)/pl.tab.h $(srcdir)/pl_scan.c
|