summaryrefslogtreecommitdiff
path: root/src/interfaces/ecpg/preproc
diff options
context:
space:
mode:
Diffstat (limited to 'src/interfaces/ecpg/preproc')
-rw-r--r--src/interfaces/ecpg/preproc/Makefile66
-rw-r--r--src/interfaces/ecpg/preproc/Makefile.in55
-rw-r--r--src/interfaces/ecpg/preproc/pgc.l4
3 files changed, 69 insertions, 56 deletions
diff --git a/src/interfaces/ecpg/preproc/Makefile b/src/interfaces/ecpg/preproc/Makefile
new file mode 100644
index 0000000000..9c23780ab4
--- /dev/null
+++ b/src/interfaces/ecpg/preproc/Makefile
@@ -0,0 +1,66 @@
+subdir = src/interfaces/ecpg/preproc
+top_builddir = ../../../..
+include ../../../Makefile.global
+
+MAJOR_VERSION=2
+MINOR_VERSION=7
+PATCHLEVEL=1
+
+CFLAGS+=-I../include -DMAJOR_VERSION=$(MAJOR_VERSION) \
+ -DMINOR_VERSION=$(MINOR_VERSION) -DPATCHLEVEL=$(PATCHLEVEL) \
+ -DINCLUDE_PATH=\"$(includedir)\"
+
+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
+ $(LEX) $(LFLAGS) $<
+ mv lex.yy.c $@
+
+install: all installdirs
+ $(INSTALL_PROGRAM) ecpg$(X) $(bindir)
+
+installdirs:
+ $(mkinstalldirs) $(bindir)
+
+uninstall:
+ rm -f $(bindir)/ecpg$(X)
+
+clean distclean:
+ rm -f *.o ecpg$(X)
+# garbage from partial builds
+ rm -f y.tab.c y.tab.h lex.yy.c
+# 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
diff --git a/src/interfaces/ecpg/preproc/Makefile.in b/src/interfaces/ecpg/preproc/Makefile.in
deleted file mode 100644
index 9d5aea9b70..0000000000
--- a/src/interfaces/ecpg/preproc/Makefile.in
+++ /dev/null
@@ -1,55 +0,0 @@
-SRCDIR= ../../..
-include $(SRCDIR)/Makefile.global
-
-MAJOR_VERSION=2
-MINOR_VERSION=7
-PATCHLEVEL=1
-
-CFLAGS+=-I../include -DMAJOR_VERSION=$(MAJOR_VERSION) \
- -DMINOR_VERSION=$(MINOR_VERSION) -DPATCHLEVEL=$(PATCHLEVEL) \
- -DINCLUDE_PATH=\"$(HEADERDIR)\"
-
-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
-
-ifneq (@SNPRINTF@,)
-OBJS+=$(SRCDIR)/backend/port/snprintf.o
-
-$(SRCDIR)/backend/port/snprintf.o:
- $(MAKE) -C $(SRCDIR)/backend/port snprintf.o
-endif
-
-# Rule that really do something.
-ecpg: $(OBJS)
- $(CC) -o ecpg $(OBJS) $(LEXLIB) $(LDFLAGS)
-
-preproc.c preproc.h: preproc.y
- $(YACC) -d $(YFLAGS) $<
- mv y.tab.c preproc.c
- mv y.tab.h preproc.h
-
-pgc.c: pgc.l
- $(LEX) $(LFLAGS) $<
- mv lex.yy.c pgc.c
-
-clean:
- rm -f *.o core a.out ecpg$(X) *~ *.output *.tab.c
-# And the garbage that might have been left behind by partial build:
- rm -f y.tab.c y.tab.h lex.yy.c
-# make clean does not remove preproc.c, preproc.h, pgc.c since we want
-# to ship those files in the distribution, for people with inadequate tools.
-
-install: all
- $(INSTALL) $(INSTL_EXE_OPTS) ecpg$(X) $(BINDIR)
-
-uninstall:
- rm -f $(BINDIR)/ecpg
-
-depend dep: preproc.c pgc.c
- $(CC) -MM $(CFLAGS) *.c >depend
-
-ifeq (depend,$(wildcard depend))
-include depend
-endif
diff --git a/src/interfaces/ecpg/preproc/pgc.l b/src/interfaces/ecpg/preproc/pgc.l
index aa741fd592..260a57cc21 100644
--- a/src/interfaces/ecpg/preproc/pgc.l
+++ b/src/interfaces/ecpg/preproc/pgc.l
@@ -12,7 +12,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/interfaces/ecpg/preproc/pgc.l,v 1.59 2000/06/14 18:17:54 petere Exp $
+ * $Header: /cvsroot/pgsql/src/interfaces/ecpg/preproc/pgc.l,v 1.60 2000/06/28 18:29:40 petere Exp $
*
*-------------------------------------------------------------------------
*/
@@ -36,6 +36,8 @@
#undef yywrap
#endif /* yywrap */
+#define YY_NO_UNPUT
+
extern YYSTYPE yylval;
/*