|
1 | 1 | #-------------------------------------------------------------------------
|
2 | 2 | #
|
3 |
| -# Makefile |
4 |
| -# Makefile for the plpgsql shared object |
| 3 | +# Makefile for the plpgsql shared object |
5 | 4 | #
|
6 |
| -# IDENTIFICATION |
7 |
| -# $Header: /cvsroot/pgsql/src/pl/plpgsql/src/Attic/Makefile.in,v 1.25 2000/06/07 16:26:54 petere Exp $ |
| 5 | +# $Header: /cvsroot/pgsql/src/pl/plpgsql/src/Attic/Makefile.in,v 1.26 2000/06/20 16:40:10 petere Exp $ |
8 | 6 | #
|
9 | 7 | #-------------------------------------------------------------------------
|
10 | 8 |
|
| 9 | +srcdir = @srcdir@ |
| 10 | +VPATH = @srcdir@ |
| 11 | + |
| 12 | +top_srcdir = @top_srcdir@ |
| 13 | +top_builddir = ../../../.. |
| 14 | +subdir = src/pl/plpgsql/src |
| 15 | + |
| 16 | + |
| 17 | +INSTALL = @INSTALL@ |
| 18 | +INSTALL_SHLIB = @INSTALL_SHLIB@ |
| 19 | +mkinstalldirs = @mkinstalldirs@ |
| 20 | +prefix = @prefix@ |
| 21 | +exec_prefix = @exec_prefix@ |
| 22 | +libdir = @libdir@ |
| 23 | + |
| 24 | + |
| 25 | +# Shared library parameters |
11 | 26 | NAME= plpgsql
|
12 | 27 | SO_MAJOR_VERSION= 1
|
13 | 28 | SO_MINOR_VERSION= 0
|
| 29 | +DLSUFFIX = @DLSUFFIX@ |
14 | 30 |
|
15 |
| -SRCDIR= ../../.. |
| 31 | +SRCDIR =$(top_srcdir)/src |
16 | 32 | include$(SRCDIR)/Makefile.global
|
17 | 33 |
|
18 |
| -# If using flex, ask for a case-insensitive, lex-compatible lexer. |
19 |
| -ifneq (,$(findstring flex,$(LEX))) |
20 |
| -LFLAGS+= -i -l |
21 |
| -endif |
22 |
| -# bsdi calls flex lex |
23 |
| -ifeq ($(PORTNAME), bsdi) |
24 |
| -LFLAGS+= -i -l |
25 |
| -endif |
| 34 | + |
| 35 | +CPPFLAGS += -I$(srcdir) |
26 | 36 |
|
27 | 37 | OBJS=pl_parse.o pl_handler.o pl_comp.o pl_exec.o pl_funcs.o
|
28 | 38 |
|
29 | 39 | # Shared library stuff, also default 'all' target
|
30 | 40 | include$(SRCDIR)/Makefile.shlib
|
31 | 41 |
|
32 | 42 |
|
33 |
| -# In order to use Makefile.shlib, we allow it to build a static library |
34 |
| -# libplpgsql.a, which we just ignore, as well as a shared library that |
35 |
| -# it will insist on naming $(shlib).We don't want to call it that when |
36 |
| -# installed, however, so we ignore the install-shlib rule and do this |
37 |
| -# instead: |
| 43 | +# In order to use Makefile.shlib, we allow it to build a static |
| 44 | +#librarylibplpgsql.a, which we just ignore, as well as a shared |
| 45 | +#library thatit will insist on naming $(shlib). We don't want to |
| 46 | +#call it that wheninstalled, however, so we ignore the install-shlib |
| 47 | +#rule and do thisinstead: |
38 | 48 |
|
39 |
| -install:$(shlib) |
| 49 | +install:installdirs$(shlib) |
40 | 50 | ifneq ($(shlib),)
|
41 |
| -$(INSTALL) $(INSTL_SHLIB_OPTS) $(shlib) $(LIBDIR)/plpgsql$(DLSUFFIX) |
| 51 | +$(INSTALL_SHLIB) $(shlib) $(libdir)/plpgsql$(DLSUFFIX) |
42 | 52 | else
|
43 |
| -@echo "plpgsql not installed due to lack of shared library support." |
| 53 | +@echo "*****"; \ |
| 54 | + echo "* PL/pgSQL was not installed due to lack of shared library support."; \ |
| 55 | + echo "*****" |
44 | 56 | endif
|
45 | 57 |
|
| 58 | +installdirs: |
| 59 | +$(mkinstalldirs)$(libdir) |
46 | 60 |
|
47 |
| -pl_handler.o:pl_handler.c plpgsql.h pl.tab.h |
48 |
| - |
49 |
| -pl_comp.o:pl_comp.c plpgsql.h pl.tab.h |
| 61 | +pl_handler.opl_comp.opl_exec.opl_funcs.o: plpgsql.h pl.tab.h |
50 | 62 |
|
51 |
| -pl_exec.o:pl_exec.c plpgsql.h pl.tab.h |
| 63 | +pl_parse.o: pl_gram.c pl_scan.c plpgsql.h |
| 64 | +$(CC) -c$(CPPFLAGS)$(CFLAGS) -o$@$< |
52 | 65 |
|
53 |
| -pl_funcs.o:pl_funcs.c plpgsql.h pl.tab.h |
| 66 | +# Note: Since the yacc and lex files are shipped in the distribution, |
| 67 | +# they must be generated in the srcdir (as opposed to builddir). |
54 | 68 |
|
55 |
| -pl_parse.o:pl_gram.c pl_scan.c plpgsql.h |
56 |
| -$(CC)$(CFLAGS) -c -o$@ pl_gram.c |
57 |
| - |
58 |
| -pl_gram.cpl.tab.h:gram.y |
| 69 | +$(srcdir)/pl_gram.c$(srcdir)/pl.tab.h: gram.y |
59 | 70 | $(YACC) -d$(YFLAGS)$<
|
60 |
| -sed -e's/yy/plpgsql_yy/g' -e's/YY/PLPGSQL_YY/g'<y.tab.c>pl_gram.c |
61 |
| -sed -e's/yy/plpgsql_yy/g' -e's/YY/PLPGSQL_YY/g'<y.tab.h>pl.tab.h |
| 71 | +sed -e's/yy/plpgsql_yy/g' -e's/YY/PLPGSQL_YY/g'<y.tab.c>$(srcdir)/pl_gram.c |
| 72 | +sed -e's/yy/plpgsql_yy/g' -e's/YY/PLPGSQL_YY/g'<y.tab.h>$(srcdir)/pl.tab.h |
62 | 73 | rm -f y.tab.c y.tab.h
|
63 | 74 |
|
64 |
| -pl_scan.c:scan.l |
65 |
| -$(LEX)$(LFLAGS)$< |
66 |
| -sed -e's/yy/plpgsql_yy/g' -e's/YY/PLPGSQL_YY/g'<lex.yy.c>pl_scan.c |
| 75 | +# Assuming flex here for -i and -l options, since scan.l requires flex anyway. |
| 76 | +$(srcdir)/pl_scan.c: scan.l |
| 77 | +$(LEX)$(LFLAGS) -i -l$< |
| 78 | +sed -e's/yy/plpgsql_yy/g' -e's/YY/PLPGSQL_YY/g'< lex.yy.c>$@ |
67 | 79 | rm -f lex.yy.c
|
68 | 80 |
|
| 81 | +mklang.sql: mklang.sql.in |
| 82 | +sed -e's%__libdir__%$(libdir)%g' -e's%__DLSUFFIX__%$(DLSUFFIX)%g'<$<>$@ |
69 | 83 |
|
70 |
| -.PHONY: install clean |
71 | 84 |
|
72 | 85 | clean: clean-shlib
|
73 |
| -rm -f lib$(NAME).a |
74 |
| -rm -f*.o |
75 |
| -# And the garbage that might have been left behind by partial build: |
76 |
| -rm -f y.tab.c y.tab.h lex.yy.c |
| 86 | +rm -f lib$(NAME).a*.o y.tab.c y.tab.h lex.yy.c mklang.sql |
| 87 | + |
| 88 | +distclean: clean |
| 89 | +rm -f Makefile |
| 90 | + |
| 91 | +maintainer-clean: clean |
| 92 | +rm -f$(srcdir)/pl_gram.c$(srcdir)/pl.tab.h$(srcdir)/pl_scan.c |
| 93 | +rm -f Makefile |
| 94 | + |
| 95 | + |
| 96 | +.PHONY: all install installdirs clean distclean maintainer-clean |
| 97 | + |
| 98 | + |
| 99 | +Makefile: Makefile.in$(top_builddir)/config.status |
| 100 | +cd$(top_builddir)&& CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= ./config.status |
| 101 | + |
| 102 | +$(top_builddir)/src/Makefile.global:$(top_srcdir)/src/Makefile.global.in$(top_builddir)/config.status |
| 103 | +cd$(top_builddir)&& CONFIG_FILES=src/Makefile.global CONFIG_HEADERS= ./config.status |
| 104 | + |
| 105 | +$(top_builddir)/config.status:$(top_srcdir)/configure |
| 106 | +cd$(top_builddir)&& ./config.status --recheck |