1996-10-27 10:55:05 +01:00
|
|
|
#-------------------------------------------------------------------------
|
|
|
|
#
|
2000-07-19 18:30:27 +02:00
|
|
|
# Makefile for the bootstrap module
|
1996-10-27 10:55:05 +01:00
|
|
|
#
|
2000-10-20 23:04:27 +02:00
|
|
|
# $Header: /cvsroot/pgsql/src/backend/bootstrap/Makefile,v 1.26 2000/10/20 21:03:41 petere Exp $
|
1996-10-27 10:55:05 +01:00
|
|
|
#
|
|
|
|
#-------------------------------------------------------------------------
|
|
|
|
|
2000-07-19 18:30:27 +02:00
|
|
|
subdir = src/backend/bootstrap
|
|
|
|
top_builddir = ../../..
|
|
|
|
include $(top_builddir)/src/Makefile.global
|
1997-04-15 19:24:26 +02:00
|
|
|
|
2000-07-19 18:30:27 +02:00
|
|
|
ifeq ($(GCC), yes)
|
2000-10-20 23:04:27 +02:00
|
|
|
override CFLAGS+= -Wno-error
|
1997-04-15 19:24:26 +02:00
|
|
|
endif
|
1996-10-27 10:55:05 +01:00
|
|
|
|
2000-07-19 18:30:27 +02:00
|
|
|
# qnx4's wlink currently crashes with bootstrap.o
|
2000-05-29 07:45:56 +02:00
|
|
|
ifneq ($(PORTNAME), qnx4)
|
1996-11-14 08:33:34 +01:00
|
|
|
OBJS= bootparse.o bootscanner.o bootstrap.o
|
2000-05-29 07:45:56 +02:00
|
|
|
else
|
|
|
|
OBJS= bootparse.o bootscanner.o
|
1999-12-16 02:25:23 +01:00
|
|
|
endif
|
1996-10-27 10:55:05 +01:00
|
|
|
|
2000-07-19 18:30:27 +02:00
|
|
|
|
2000-05-29 07:45:56 +02:00
|
|
|
# make sure bootstrap.o is built even on qnx4
|
|
|
|
all: SUBSYS.o bootstrap.o
|
1996-10-27 10:55:05 +01:00
|
|
|
|
|
|
|
SUBSYS.o: $(OBJS)
|
2000-07-19 18:30:27 +02:00
|
|
|
$(LD) $(LDREL) $(LDOUT) $@ $^
|
|
|
|
|
1996-10-27 10:55:05 +01:00
|
|
|
|
2000-07-19 18:30:27 +02:00
|
|
|
bootstrap.o bootscanner.c: $(srcdir)/bootstrap_tokens.h
|
1996-10-27 10:55:05 +01:00
|
|
|
|
|
|
|
|
2000-07-19 18:30:27 +02:00
|
|
|
# `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
|
2000-06-07 18:27:00 +02:00
|
|
|
$(YACC) -d $(YFLAGS) $<
|
2000-07-19 18:30:27 +02:00
|
|
|
$(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
|
1996-10-27 10:55:05 +01:00
|
|
|
|
2000-07-19 18:30:27 +02:00
|
|
|
$(srcdir)/bootscanner.c: bootscanner.l Makefile
|
2000-08-28 13:53:23 +02:00
|
|
|
ifdef FLEX
|
|
|
|
$(FLEX) $(FLEXFLAGS) $<
|
|
|
|
$(sed-magic) lex.yy.c > $@
|
2000-07-19 18:30:27 +02:00
|
|
|
rm -f lex.yy.c
|
2000-08-28 13:53:23 +02:00
|
|
|
else
|
|
|
|
@$(missing) flex $< $@
|
|
|
|
endif
|
1996-10-27 10:55:05 +01:00
|
|
|
|
|
|
|
clean:
|
2000-05-29 07:45:56 +02:00
|
|
|
rm -f SUBSYS.o $(OBJS) bootstrap.o
|
1996-10-27 10:55:05 +01:00
|
|
|
# And the garbage that might have been left behind by partial build:
|
2000-07-19 18:30:27 +02:00
|
|
|
@rm -f y.tab.h y.tab.c y.output lex.yy.c
|
|
|
|
|
1996-10-27 10:55:05 +01:00
|
|
|
|
|
|
|
# This is unusual: We actually have to build some of the parts before
|
|
|
|
# we know what the header file dependencies are.
|
1998-04-06 02:32:26 +02:00
|
|
|
dep depend: bootparse.c bootscanner.c bootstrap_tokens.h
|
|
|
|
$(CC) -MM $(CFLAGS) *.c >depend
|
1996-10-27 10:55:05 +01:00
|
|
|
|
|
|
|
ifeq (depend,$(wildcard depend))
|
|
|
|
include depend
|
|
|
|
endif
|