22#
33# Makefile for the bootstrap module
44#
5- # $PostgreSQL: pgsql/src/backend/bootstrap/Makefile,v 1.33 2006/01/05 01:56:29 momjian Exp $
5+ # $PostgreSQL: pgsql/src/backend/bootstrap/Makefile,v 1.34 2006/03/07 01:03:12 tgl Exp $
66#
77# -------------------------------------------------------------------------
88
@@ -20,43 +20,37 @@ SUBSYS.o: $(OBJS)
2020 $(LD ) $(LDREL ) $(LDOUT ) $@ $^
2121
2222
23- bootstrap.o bootparse.o : $(srcdir ) /bootstrap_tokens.h
24-
2523# bootscanner is compiled as part of bootparse
2624bootparse.o : $(srcdir ) /bootscanner.c
2725
28- # `sed' rules to remove conflicts between bootstrap scanner and parser
29- # and the SQL scanner and parser. For correctness' sake the rules that
30- # use this must depend on this Makefile.
31- define sed-magic
32- sed -e 's/^yy/Int_yy/g' \
33- -e 's/\([^a-zA-Z0-9_]\)yy/\1Int_yy/g'
34- endef
35-
26+ # See notes in src/backend/parser/Makefile about the following two rules
3627
3728$(srcdir ) /bootparse.c : $(srcdir ) /bootstrap_tokens.h ;
3829
39- $(srcdir ) /bootstrap_tokens.h : bootparse.y Makefile
30+ $(srcdir ) /bootstrap_tokens.h : bootparse.y
4031ifdef YACC
4132 $(YACC) -d $(YFLAGS) $<
42- $(sed-magic) < y.tab.c > $(srcdir)/bootparse.c
43- $(sed-magic) < y.tab.h > $(srcdir)/bootstrap_tokens.h
44- rm -f y.tab.c y.tab.h
33+ mv -f y.tab.c $(srcdir)/bootparse.c
34+ mv -f y.tab.h $(srcdir)/bootstrap_tokens.h
4535else
4636 @$(missing) bison $< $@
4737endif
4838
49- $(srcdir ) /bootscanner.c : bootscanner.l Makefile
39+ $(srcdir ) /bootscanner.c : bootscanner.l
5040ifdef FLEX
51- $(FLEX) $(FLEXFLAGS) $<
52- $(sed-magic) lex.yy.c > $@
53- rm -f lex.yy.c
41+ $(FLEX) $(FLEXFLAGS) -o'$@' $<
5442else
5543 @$(missing) flex $< $@
5644endif
5745
46+ # Force these dependencies to be known even without dependency info built:
47+ bootstrap.o bootparse.o : $(srcdir ) /bootstrap_tokens.h
48+
49+
50+ # bootparse.c, bootstrap_tokens.h, and bootscanner.c are in the distribution
51+ # tarball, so they are not cleaned here.
5852clean :
59- rm -f SUBSYS.o $(OBJS ) bootstrap.o
53+ rm -f SUBSYS.o $(OBJS )
6054# And the garbage that might have been left behind by partial build:
6155 @rm -f y.tab.h y.tab.c y.output lex.yy.c
6256
0 commit comments