2004-10-04 15:43:59 +02:00
|
|
|
#-------------------------------------------------------------------------
|
|
|
|
#
|
|
|
|
# Makefile for src/interfaces/ecpg/preproc
|
|
|
|
#
|
|
|
|
# Copyright (c) 1998-2002, PostgreSQL Global Development Group
|
|
|
|
#
|
|
|
|
# $PostgreSQL: pgsql/src/interfaces/ecpg/preproc/Makefile,v 1.108 2004/10/04 13:43:58 momjian Exp $
|
|
|
|
#
|
|
|
|
#-------------------------------------------------------------------------
|
2000-11-30 21:36:13 +01:00
|
|
|
|
2000-06-28 20:30:16 +02:00
|
|
|
subdir = src/interfaces/ecpg/preproc
|
|
|
|
top_builddir = ../../../..
|
2000-08-31 18:12:35 +02:00
|
|
|
include $(top_builddir)/src/Makefile.global
|
2000-06-28 20:30:16 +02:00
|
|
|
|
2003-06-15 06:07:58 +02:00
|
|
|
MAJOR_VERSION=3
|
2004-03-02 07:45:05 +01:00
|
|
|
MINOR_VERSION=2
|
|
|
|
PATCHLEVEL=0
|
2000-06-28 20:30:16 +02:00
|
|
|
|
2004-04-25 22:57:32 +02:00
|
|
|
override CPPFLAGS := -I$(srcdir)/../include -I$(srcdir) $(CPPFLAGS) \
|
2001-02-20 20:20:30 +01:00
|
|
|
-DMAJOR_VERSION=$(MAJOR_VERSION) \
|
2004-10-04 15:43:59 +02:00
|
|
|
-DMINOR_VERSION=$(MINOR_VERSION) -DPATCHLEVEL=$(PATCHLEVEL)
|
2000-06-28 20:30:16 +02:00
|
|
|
|
2002-02-23 05:16:04 +01:00
|
|
|
ifeq ($(GCC), yes)
|
|
|
|
override CFLAGS += -Wno-error
|
|
|
|
endif
|
2004-04-25 22:57:32 +02:00
|
|
|
override CFLAGS += $(PTHREAD_CFLAGS)
|
2002-02-23 05:16:04 +01:00
|
|
|
|
2004-05-17 16:35:34 +02:00
|
|
|
OBJS= preproc.o type.o ecpg.o ecpg_keywords.o output.o\
|
2004-10-04 15:43:59 +02:00
|
|
|
keywords.o c_keywords.o ../ecpglib/typename.o descriptor.o variable.o
|
2000-06-28 20:30:16 +02:00
|
|
|
|
2002-07-27 22:10:05 +02:00
|
|
|
all: submake-libpgport ecpg
|
2000-06-28 20:30:16 +02:00
|
|
|
|
|
|
|
ecpg: $(OBJS)
|
2004-04-26 19:40:48 +02:00
|
|
|
$(CC) $(CFLAGS) $(LDFLAGS) $^ $(LIBS) $(PTHREAD_LIBS) -o $@$(X)
|
2000-06-28 20:30:16 +02:00
|
|
|
|
2002-11-01 23:52:34 +01:00
|
|
|
# pgc is compiled as part of preproc
|
|
|
|
preproc.o: $(srcdir)/pgc.c
|
|
|
|
|
2001-11-16 17:32:33 +01:00
|
|
|
$(srcdir)/preproc.c: $(srcdir)/preproc.h ;
|
|
|
|
|
|
|
|
$(srcdir)/preproc.h: preproc.y
|
2001-02-10 23:31:42 +01:00
|
|
|
ifdef YACC
|
2000-06-28 20:30:16 +02:00
|
|
|
$(YACC) -d $(YFLAGS) $<
|
2001-11-16 17:32:33 +01:00
|
|
|
mv -f y.tab.c $(srcdir)/preproc.c
|
|
|
|
mv -f y.tab.h $(srcdir)/preproc.h
|
2001-02-10 23:31:42 +01:00
|
|
|
else
|
|
|
|
@$(missing) bison $< $@
|
|
|
|
endif
|
2000-06-28 20:30:16 +02:00
|
|
|
|
|
|
|
$(srcdir)/pgc.c: pgc.l
|
2000-08-28 13:53:23 +02:00
|
|
|
ifdef FLEX
|
|
|
|
$(FLEX) $(FLEXFLAGS) -o'$@' $<
|
|
|
|
else
|
|
|
|
@$(missing) flex $< $@
|
|
|
|
endif
|
2000-06-28 20:30:16 +02:00
|
|
|
|
2002-11-01 23:52:34 +01:00
|
|
|
c_keywords.o ecpg_keywords.o keywords.o preproc.o: preproc.h
|
2000-11-08 19:56:25 +01:00
|
|
|
|
|
|
|
|
2000-07-19 18:30:27 +02:00
|
|
|
distprep: $(srcdir)/preproc.c $(srcdir)/preproc.h $(srcdir)/pgc.c
|
|
|
|
|
2000-06-28 20:30:16 +02:00
|
|
|
install: all 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
|
|
|
$(INSTALL_PROGRAM) ecpg$(X) $(DESTDIR)$(bindir)
|
2000-06-28 20:30:16 +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)$(bindir)
|
2000-06-28 20:30:16 +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)$(bindir)/ecpg$(X)
|
2000-06-28 20:30:16 +02:00
|
|
|
|
|
|
|
clean distclean:
|
2004-10-04 15:43:59 +02:00
|
|
|
rm -f *.o ecpg$(X)
|
2000-06-28 20:30:16 +02:00
|
|
|
# garbage from partial builds
|
2000-08-28 13:53:23 +02:00
|
|
|
@rm -f y.tab.c y.tab.h
|
2000-06-28 20:30:16 +02:00
|
|
|
# garbage from development
|
|
|
|
@rm -f core a.out *~ *.output *.tab.c
|
|
|
|
|
|
|
|
# `make clean' does not remove preproc.c, preproc.h, or pgc.c since we
|
|
|
|
# want to ship those files in the distribution for people with
|
|
|
|
# inadequate tools.
|
|
|
|
maintainer-clean: distclean
|
|
|
|
rm -f $(srcdir)/preproc.c $(srcdir)/preproc.h $(srcdir)/pgc.c
|