~vcs-imports/mammoth-replicator/trunk

« back to all changes in this revision

Viewing changes to src/backend/bootstrap/Makefile

  • Committer: alvherre
  • Date: 2005-12-16 21:24:52 UTC
  • Revision ID: svn-v4:db760fc0-0f08-0410-9d63-cc6633f64896:trunk:1
Initial import of the REL8_0_3 sources from the Pgsql CVS repository.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#-------------------------------------------------------------------------
 
2
#
 
3
# Makefile for the bootstrap module
 
4
#
 
5
# $PostgreSQL: pgsql/src/backend/bootstrap/Makefile,v 1.32 2003-11-29 19:51:40 pgsql Exp $
 
6
#
 
7
#-------------------------------------------------------------------------
 
8
 
 
9
subdir = src/backend/bootstrap
 
10
top_builddir = ../../..
 
11
include $(top_builddir)/src/Makefile.global
 
12
 
 
13
override CPPFLAGS := -I$(srcdir) $(CPPFLAGS)
 
14
 
 
15
# qnx4's wlink currently crashes with bootstrap.o
 
16
ifneq ($(PORTNAME), qnx4)
 
17
OBJS= bootparse.o bootstrap.o 
 
18
else
 
19
OBJS= bootparse.o
 
20
endif
 
21
 
 
22
 
 
23
# make sure bootstrap.o is built even on qnx4
 
24
all: SUBSYS.o bootstrap.o
 
25
 
 
26
SUBSYS.o: $(OBJS)
 
27
        $(LD) $(LDREL) $(LDOUT) $@ $^
 
28
 
 
29
 
 
30
bootstrap.o bootparse.o: $(srcdir)/bootstrap_tokens.h
 
31
 
 
32
# bootscanner is compiled as part of bootparse
 
33
bootparse.o: $(srcdir)/bootscanner.c
 
34
 
 
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.
 
38
define sed-magic
 
39
sed -e 's/^yy/Int_yy/g' \
 
40
    -e 's/\([^a-zA-Z0-9_]\)yy/\1Int_yy/g'
 
41
endef
 
42
 
 
43
 
 
44
$(srcdir)/bootparse.c: $(srcdir)/bootstrap_tokens.h ;
 
45
 
 
46
$(srcdir)/bootstrap_tokens.h: bootparse.y Makefile
 
47
ifdef YACC
 
48
        $(YACC) -d $(YFLAGS) $<
 
49
        $(sed-magic) < y.tab.c > $(srcdir)/bootparse.c
 
50
        $(sed-magic) < y.tab.h > $(srcdir)/bootstrap_tokens.h
 
51
        rm -f y.tab.c y.tab.h
 
52
else
 
53
        @$(missing) bison $< $@
 
54
endif
 
55
 
 
56
$(srcdir)/bootscanner.c: bootscanner.l Makefile
 
57
ifdef FLEX
 
58
        $(FLEX) $(FLEXFLAGS) $<
 
59
        $(sed-magic) lex.yy.c > $@
 
60
        rm -f lex.yy.c
 
61
else
 
62
        @$(missing) flex $< $@
 
63
endif
 
64
 
 
65
clean:
 
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
 
69
 
 
70
 
 
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
 
75
 
 
76
ifeq (depend,$(wildcard depend))
 
77
include depend
 
78
endif