1
#-------------------------------------------------------------------------
3
# Makefile for the bootstrap module
5
# $PostgreSQL: pgsql/src/backend/bootstrap/Makefile,v 1.32 2003-11-29 19:51:40 pgsql Exp $
7
#-------------------------------------------------------------------------
9
subdir = src/backend/bootstrap
10
top_builddir = ../../..
11
include $(top_builddir)/src/Makefile.global
13
override CPPFLAGS := -I$(srcdir) $(CPPFLAGS)
15
# qnx4's wlink currently crashes with bootstrap.o
16
ifneq ($(PORTNAME), qnx4)
17
OBJS= bootparse.o bootstrap.o
23
# make sure bootstrap.o is built even on qnx4
24
all: SUBSYS.o bootstrap.o
27
$(LD) $(LDREL) $(LDOUT) $@ $^
30
bootstrap.o bootparse.o: $(srcdir)/bootstrap_tokens.h
32
# bootscanner is compiled as part of bootparse
33
bootparse.o: $(srcdir)/bootscanner.c
35
# `sed' rules to remove conflicts between bootstrap scanner and parser
36
# and the SQL scanner and parser. For correctness' sake the rules that
37
# use this must depend on this Makefile.
39
sed -e 's/^yy/Int_yy/g' \
40
-e 's/\([^a-zA-Z0-9_]\)yy/\1Int_yy/g'
44
$(srcdir)/bootparse.c: $(srcdir)/bootstrap_tokens.h ;
46
$(srcdir)/bootstrap_tokens.h: bootparse.y Makefile
48
$(YACC) -d $(YFLAGS) $<
49
$(sed-magic) < y.tab.c > $(srcdir)/bootparse.c
50
$(sed-magic) < y.tab.h > $(srcdir)/bootstrap_tokens.h
53
@$(missing) bison $< $@
56
$(srcdir)/bootscanner.c: bootscanner.l Makefile
58
$(FLEX) $(FLEXFLAGS) $<
59
$(sed-magic) lex.yy.c > $@
62
@$(missing) flex $< $@
66
rm -f SUBSYS.o $(OBJS) bootstrap.o
67
# And the garbage that might have been left behind by partial build:
68
@rm -f y.tab.h y.tab.c y.output lex.yy.c
71
# This is unusual: We actually have to build some of the parts before
72
# we know what the header file dependencies are.
73
dep depend: bootparse.c bootscanner.c bootstrap_tokens.h
74
$(CC) -MM $(CFLAGS) *.c >depend
76
ifeq (depend,$(wildcard depend))