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
|
|
|
|
|
|
|
MAJOR_VERSION=2
|
2000-09-19 13:47:16 +02:00
|
|
|
MINOR_VERSION=8
|
|
|
|
PATCHLEVEL=0
|
2000-06-28 20:30:16 +02:00
|
|
|
|
2000-10-20 23:04:27 +02:00
|
|
|
override CPPFLAGS+=-I$(srcdir)/../include -DMAJOR_VERSION=$(MAJOR_VERSION) \
|
2000-06-28 20:30:16 +02:00
|
|
|
-DMINOR_VERSION=$(MINOR_VERSION) -DPATCHLEVEL=$(PATCHLEVEL) \
|
|
|
|
-DINCLUDE_PATH=\"$(includedir)\"
|
2000-11-07 09:46:27 +01:00
|
|
|
# -DYYDEBUG -g
|
2000-06-28 20:30:16 +02:00
|
|
|
|
|
|
|
OBJS=preproc.o pgc.o type.o ecpg.o ecpg_keywords.o output.o\
|
|
|
|
keywords.o c_keywords.o ../lib/typename.o descriptor.o variable.o
|
|
|
|
|
|
|
|
all: ecpg
|
|
|
|
|
|
|
|
ifdef SNPRINTF
|
|
|
|
OBJS+=$(top_builddir)/src/backend/port/snprintf.o
|
|
|
|
|
|
|
|
$(top_builddir)/src/backend/port/snprintf.o:
|
|
|
|
$(MAKE) -C $(top_builddir)/src/backend/port snprintf.o
|
|
|
|
endif
|
|
|
|
|
|
|
|
|
|
|
|
ecpg: $(OBJS)
|
|
|
|
$(CC) -o $@ $^ $(LDFLAGS)
|
|
|
|
|
|
|
|
$(srcdir)/preproc.c $(srcdir)/preproc.h: preproc.y
|
|
|
|
$(YACC) -d $(YFLAGS) $<
|
|
|
|
mv y.tab.c $(srcdir)/preproc.c
|
|
|
|
mv y.tab.h $(srcdir)/preproc.h
|
|
|
|
|
|
|
|
$(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
|
|
|
|
2000-11-08 19:56:25 +01:00
|
|
|
c_keywords.o ecpg_keywords.o keywords.o pgc.o: preproc.h
|
|
|
|
|
|
|
|
|
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:
|
|
|
|
rm -f *.o ecpg$(X)
|
|
|
|
# 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
|
|
|
|
|
|
|
|
|
|
|
|
depend dep: preproc.c pgc.c
|
|
|
|
$(CC) -MM $(CFLAGS) *.c >depend
|
|
|
|
|
|
|
|
ifeq (depend,$(wildcard depend))
|
|
|
|
include depend
|
|
|
|
endif
|