Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
summaryrefslogtreecommitdiff
blob: 681043ca52ff9b996c63f4251e93e169c4f895ea (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
#-------------------------------------------------------------------------
#
# Makefile for the bootstrap module
#
# $Header: /cvsroot/pgsql/src/backend/bootstrap/Makefile,v 1.26 2000/10/20 21:03:41 petere Exp $
#
#-------------------------------------------------------------------------

subdir = src/backend/bootstrap
top_builddir = ../../..
include $(top_builddir)/src/Makefile.global

ifeq ($(GCC), yes)
override CFLAGS+= -Wno-error
endif

# qnx4's wlink currently crashes with bootstrap.o
ifneq ($(PORTNAME), qnx4)
OBJS= bootparse.o bootscanner.o bootstrap.o 
else
OBJS= bootparse.o bootscanner.o
endif


# make sure bootstrap.o is built even on qnx4
all: SUBSYS.o bootstrap.o

SUBSYS.o: $(OBJS)
	$(LD) $(LDREL) $(LDOUT) $@ $^


bootstrap.o bootscanner.c: $(srcdir)/bootstrap_tokens.h


# `sed' rules to remove conflicts between bootstrap scanner and parser
# and the SQL scanner and parser. For correctness' sake the rules that
# use this must depend on this Makefile.
define sed-magic
sed -e 's/^yy/Int_yy/g' \
    -e 's/\([^a-zA-Z0-9_]\)yy/\1Int_yy/g'
endef


$(srcdir)/bootparse.c $(srcdir)/bootstrap_tokens.h: bootparse.y Makefile
	$(YACC) -d $(YFLAGS) $<
	$(sed-magic) < y.tab.c > $(srcdir)/bootparse.c
	$(sed-magic) < y.tab.h > $(srcdir)/bootstrap_tokens.h
	rm -f y.tab.c y.tab.h

$(srcdir)/bootscanner.c: bootscanner.l Makefile
ifdef FLEX
	$(FLEX) $(FLEXFLAGS) $<
	$(sed-magic) lex.yy.c > $@
	rm -f lex.yy.c
else
	@$(missing) flex $< $@
endif

clean:
	rm -f SUBSYS.o $(OBJS) bootstrap.o
# And the garbage that might have been left behind by partial build:
	@rm -f y.tab.h y.tab.c y.output lex.yy.c


# This is unusual:  We actually have to build some of the parts before
# we know what the header file dependencies are.  
dep depend: bootparse.c bootscanner.c bootstrap_tokens.h
	$(CC) -MM $(CFLAGS) *.c >depend

ifeq (depend,$(wildcard depend))
include depend
endif