Enable script to generate preproc.y in build process.
This commit is contained in:
parent
a76e98f021
commit
b78f9b496d
@ -1,3 +1,4 @@
|
||||
preproc.y
|
||||
preproc.c
|
||||
preproc.h
|
||||
pgc.c
|
||||
|
@ -4,7 +4,7 @@
|
||||
#
|
||||
# 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 $
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
|
||||
@ -38,27 +38,30 @@ preproc.o: $(srcdir)/pgc.c
|
||||
|
||||
$(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)'
|
||||
@ -78,4 +81,4 @@ clean distclean:
|
||||
# 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
|
||||
|
@ -3,7 +3,7 @@ package Solution;
|
||||
#
|
||||
# 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;
|
||||
@ -237,6 +237,19 @@ s{PG_VERSION_STR "[^"]+"}{__STRINGIFY(x) #x\n#define __STRINGIFY2(z) __STRINGIFY
|
||||
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',
|
||||
|
Loading…
x
Reference in New Issue
Block a user