#
# Copyright (c) 1998-2008, PostgreSQL Global Development Group
#
-# $PostgreSQL: pgsql/src/interfaces/ecpg/preproc/Makefile,v 1.137 2008/10/14 09:31:04 meskes Exp $
+# $PostgreSQL: pgsql/src/interfaces/ecpg/preproc/Makefile,v 1.138 2008/11/14 17:11:40 meskes Exp $
#
#-------------------------------------------------------------------------
$(srcdir)/preproc.h: $(srcdir)/preproc.c ;
-$(srcdir)/preproc.c: preproc.y
+$(srcdir)/preproc.c: $(srcdir)/preproc.y
ifdef BISON
$(BISON) -d $(BISONFLAGS) -o $@ $<
else
@$(missing) bison $< $@
endif
-$(srcdir)/pgc.c: pgc.l
+$(srcdir)/pgc.c: $(srcdir)/pgc.l
ifdef FLEX
$(FLEX) $(FLEXFLAGS) -o'$@' $<
else
@$(missing) flex $< $@
endif
+$(srcdir)/preproc.y: $(top_srcdir)/src/backend/parser/gram.y
+ $(PERL) $(srcdir)/parse.pl $(srcdir) < $< > $@
+
ecpg_keywords.o c_keywords.o keywords.o preproc.o parser.o: preproc.h
# instead of maintaining our own list, take the one from the backend
keywords.c: % : $(top_srcdir)/src/backend/parser/%
rm -f $@ && $(LN_S) $< .
-distprep: $(srcdir)/preproc.c $(srcdir)/preproc.h $(srcdir)/pgc.c
+distprep: $(srcdir)/preproc.y $(srcdir)/preproc.c $(srcdir)/preproc.h $(srcdir)/pgc.c
install: all installdirs
$(INSTALL_PROGRAM) ecpg$(X) '$(DESTDIR)$(bindir)'
# 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
+ rm -f $(srcdir)/preproc.y $(srcdir)/preproc.c $(srcdir)/preproc.h $(srcdir)/pgc.c
#
# Package that encapsulates a Visual C++ solution file generation
#
-# $PostgreSQL: pgsql/src/tools/msvc/Solution.pm,v 1.44 2008/08/16 12:42:27 mha Exp $
+# $PostgreSQL: pgsql/src/tools/msvc/Solution.pm,v 1.45 2008/11/14 17:11:40 meskes Exp $
#
use Carp;
use strict;
chdir('..\..\..');
}
+ if (
+ IsNewer(
+ 'src\interfaces\ecpg\preproc\preproc.y',
+ 'src\backend\parser\gram.y'
+ )
+ )
+ {
+ print "Generating preproc.y...\n";
+ chdir('src\interfaces\ecpg\preproc');
+ system('perl parse.pl < ..\..\..\backend\parser\gram.y > preproc.y');
+ chdir('..\..\..\..');
+ }
+
if (
IsNewer(
'src\interfaces\ecpg\include\ecpg_config.h',