Skip to content

Commit b78f9b4

Browse files
author
Michael Meskes
committed
Enable script to generate preproc.y in build process.
1 parent a76e98f commit b78f9b4

File tree

3 files changed

+23
-6
lines changed

3 files changed

+23
-6
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
preproc.y
12
preproc.c
23
preproc.h
34
pgc.c

src/interfaces/ecpg/preproc/Makefile

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
#
55
# Copyright (c) 1998-2008, PostgreSQL Global Development Group
66
#
7-
# $PostgreSQL: pgsql/src/interfaces/ecpg/preproc/Makefile,v 1.137 2008/10/14 09:31:04 meskes Exp $
7+
# $PostgreSQL: pgsql/src/interfaces/ecpg/preproc/Makefile,v 1.138 2008/11/14 17:11:40 meskes Exp $
88
#
99
#-------------------------------------------------------------------------
1010

@@ -38,27 +38,30 @@ preproc.o: $(srcdir)/pgc.c
3838

3939
$(srcdir)/preproc.h: $(srcdir)/preproc.c ;
4040

41-
$(srcdir)/preproc.c: preproc.y
41+
$(srcdir)/preproc.c: $(srcdir)/preproc.y
4242
ifdef BISON
4343
$(BISON) -d $(BISONFLAGS) -o $@ $<
4444
else
4545
@$(missing) bison $< $@
4646
endif
4747

48-
$(srcdir)/pgc.c: pgc.l
48+
$(srcdir)/pgc.c: $(srcdir)/pgc.l
4949
ifdef FLEX
5050
$(FLEX) $(FLEXFLAGS) -o'$@' $<
5151
else
5252
@$(missing) flex $< $@
5353
endif
5454

55+
$(srcdir)/preproc.y: $(top_srcdir)/src/backend/parser/gram.y
56+
$(PERL) $(srcdir)/parse.pl $(srcdir) < $< > $@
57+
5558
ecpg_keywords.o c_keywords.o keywords.o preproc.o parser.o: preproc.h
5659

5760
# instead of maintaining our own list, take the one from the backend
5861
keywords.c: % : $(top_srcdir)/src/backend/parser/%
5962
rm -f $@ && $(LN_S) $< .
6063

61-
distprep: $(srcdir)/preproc.c $(srcdir)/preproc.h $(srcdir)/pgc.c
64+
distprep: $(srcdir)/preproc.y $(srcdir)/preproc.c $(srcdir)/preproc.h $(srcdir)/pgc.c
6265

6366
install: all installdirs
6467
$(INSTALL_PROGRAM) ecpg$(X) '$(DESTDIR)$(bindir)'
@@ -78,4 +81,4 @@ clean distclean:
7881
# want to ship those files in the distribution for people with
7982
# inadequate tools.
8083
maintainer-clean: distclean
81-
rm -f $(srcdir)/preproc.c $(srcdir)/preproc.h $(srcdir)/pgc.c
84+
rm -f $(srcdir)/preproc.y $(srcdir)/preproc.c $(srcdir)/preproc.h $(srcdir)/pgc.c

src/tools/msvc/Solution.pm

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ package Solution;
33
#
44
# Package that encapsulates a Visual C++ solution file generation
55
#
6-
# $PostgreSQL: pgsql/src/tools/msvc/Solution.pm,v 1.44 2008/08/16 12:42:27 mha Exp $
6+
# $PostgreSQL: pgsql/src/tools/msvc/Solution.pm,v 1.45 2008/11/14 17:11:40 meskes Exp $
77
#
88
use Carp;
99
use strict;
@@ -237,6 +237,19 @@ s{PG_VERSION_STR "[^"]+"}{__STRINGIFY(x) #x\n#define __STRINGIFY2(z) __STRINGIFY
237237
chdir('..\..\..');
238238
}
239239

240+
if (
241+
IsNewer(
242+
'src\interfaces\ecpg\preproc\preproc.y',
243+
'src\backend\parser\gram.y'
244+
)
245+
)
246+
{
247+
print "Generating preproc.y...\n";
248+
chdir('src\interfaces\ecpg\preproc');
249+
system('perl parse.pl < ..\..\..\backend\parser\gram.y > preproc.y');
250+
chdir('..\..\..\..');
251+
}
252+
240253
if (
241254
IsNewer(
242255
'src\interfaces\ecpg\include\ecpg_config.h',

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy