postgresql/src/pl/plpgsql/src/Makefile.in

107 lines
3.0 KiB
Makefile
Raw Normal View History

1998-09-25 17:50:02 +02:00
#-------------------------------------------------------------------------
#
# Makefile for the plpgsql shared object
1998-09-25 17:50:02 +02:00
#
# $Header: /cvsroot/pgsql/src/pl/plpgsql/src/Attic/Makefile.in,v 1.26 2000/06/20 16:40:10 petere Exp $
1998-09-25 17:50:02 +02:00
#
#-------------------------------------------------------------------------
srcdir = @srcdir@
VPATH = @srcdir@
top_srcdir = @top_srcdir@
top_builddir = ../../../..
subdir = src/pl/plpgsql/src
INSTALL = @INSTALL@
INSTALL_SHLIB = @INSTALL_SHLIB@
mkinstalldirs = @mkinstalldirs@
prefix = @prefix@
exec_prefix = @exec_prefix@
libdir = @libdir@
# Shared library parameters
NAME= plpgsql
SO_MAJOR_VERSION= 1
SO_MINOR_VERSION= 0
DLSUFFIX = @DLSUFFIX@
1998-09-25 17:50:02 +02:00
SRCDIR = $(top_srcdir)/src
1998-09-25 17:50:02 +02:00
include $(SRCDIR)/Makefile.global
CPPFLAGS += -I$(srcdir)
1998-09-25 17:50:02 +02:00
OBJS= pl_parse.o pl_handler.o pl_comp.o pl_exec.o pl_funcs.o
# Shared library stuff, also default 'all' target
include $(SRCDIR)/Makefile.shlib
1998-09-25 17:50:02 +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
install: installdirs $(shlib)
ifneq ($(shlib),)
$(INSTALL_SHLIB) $(shlib) $(libdir)/plpgsql$(DLSUFFIX)
else
@echo "*****"; \
echo "* PL/pgSQL was not installed due to lack of shared library support."; \
echo "*****"
endif
1998-09-25 17:50:02 +02:00
installdirs:
$(mkinstalldirs) $(libdir)
1998-09-25 17:50:02 +02:00
pl_handler.o pl_comp.o pl_exec.o pl_funcs.o: plpgsql.h pl.tab.h
1998-09-25 17:50:02 +02:00
pl_parse.o: pl_gram.c pl_scan.c plpgsql.h
$(CC) -c $(CPPFLAGS) $(CFLAGS) -o $@ $<
1998-09-25 17:50:02 +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
$(srcdir)/pl_gram.c $(srcdir)/pl.tab.h: gram.y
$(YACC) -d $(YFLAGS) $<
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
rm -f y.tab.c y.tab.h
1998-09-25 17:50:02 +02:00
# Assuming flex here for -i and -l options, since scan.l requires flex anyway.
$(srcdir)/pl_scan.c: scan.l
$(LEX) $(LFLAGS) -i -l $<
sed -e 's/yy/plpgsql_yy/g' -e 's/YY/PLPGSQL_YY/g' < lex.yy.c > $@
rm -f lex.yy.c
mklang.sql: mklang.sql.in
sed -e 's%__libdir__%$(libdir)%g' -e 's%__DLSUFFIX__%$(DLSUFFIX)%g' < $< > $@
clean: clean-shlib
rm -f lib$(NAME).a *.o y.tab.c y.tab.h lex.yy.c mklang.sql
distclean: clean
rm -f Makefile
maintainer-clean: clean
rm -f $(srcdir)/pl_gram.c $(srcdir)/pl.tab.h $(srcdir)/pl_scan.c
rm -f Makefile
.PHONY: all install installdirs clean distclean maintainer-clean
Makefile: Makefile.in $(top_builddir)/config.status
cd $(top_builddir) && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= ./config.status
$(top_builddir)/src/Makefile.global: $(top_srcdir)/src/Makefile.global.in $(top_builddir)/config.status
cd $(top_builddir) && CONFIG_FILES=src/Makefile.global CONFIG_HEADERS= ./config.status
$(top_builddir)/config.status: $(top_srcdir)/configure
cd $(top_builddir) && ./config.status --recheck