1996-10-27 10:55:05 +01:00
|
|
|
#-------------------------------------------------------------------------
|
|
|
|
#
|
|
|
|
# Makefile--
|
|
|
|
# Makefile for the bootstrap module
|
|
|
|
#
|
|
|
|
# IDENTIFICATION
|
1999-12-16 02:25:23 +01:00
|
|
|
# $Header: /cvsroot/pgsql/src/backend/bootstrap/Makefile,v 1.18 1999/12/16 01:25:01 momjian Exp $
|
1996-10-27 10:55:05 +01:00
|
|
|
#
|
|
|
|
#
|
|
|
|
# We must build bootparse.c and bootscanner.c with yacc and lex and sed,
|
|
|
|
# but bootstrap.c is part of the distribution.
|
|
|
|
#
|
|
|
|
# Another kinda weird Makefile cause we need two
|
|
|
|
# scanner/parsers in the backend and most yaccs and lexs
|
|
|
|
# don't have the prefix option.
|
|
|
|
#
|
|
|
|
# sed files are HACK CITY! - redo...
|
|
|
|
#
|
|
|
|
#-------------------------------------------------------------------------
|
|
|
|
|
1996-11-14 08:33:34 +01:00
|
|
|
SRCDIR= ../..
|
1996-10-27 10:55:05 +01:00
|
|
|
include ../../Makefile.global
|
|
|
|
|
1998-04-06 02:32:26 +02:00
|
|
|
CFLAGS += -I..
|
1998-07-26 06:31:41 +02:00
|
|
|
ifdef MULTIBYTE
|
|
|
|
CFLAGS+= $(MBFLAGS)
|
1998-07-24 05:32:46 +02:00
|
|
|
endif
|
1997-04-15 19:24:26 +02:00
|
|
|
|
1997-04-18 10:57:39 +02:00
|
|
|
ifeq ($(CC), gcc)
|
1997-04-15 19:24:26 +02:00
|
|
|
CFLAGS+= -Wno-error
|
|
|
|
endif
|
1996-10-27 10:55:05 +01:00
|
|
|
|
1996-11-14 08:33:34 +01:00
|
|
|
BOOTYACCS= bootstrap_tokens.h bootparse.c
|
|
|
|
|
1999-12-16 02:25:23 +01:00
|
|
|
ifneq ($(PORTNAME), qnx4)
|
1996-11-14 08:33:34 +01:00
|
|
|
OBJS= bootparse.o bootscanner.o bootstrap.o
|
1999-12-16 02:25:23 +01:00
|
|
|
else
|
|
|
|
# wlink crashes with bootstrap.o
|
|
|
|
OBJS= bootparse.o bootscanner.o
|
|
|
|
endif
|
1996-10-27 10:55:05 +01:00
|
|
|
|
|
|
|
all: SUBSYS.o
|
|
|
|
|
|
|
|
SUBSYS.o: $(OBJS)
|
1999-12-13 23:35:27 +01:00
|
|
|
$(LD) $(LDREL) $(LDOUT) SUBSYS.o $(OBJS)
|
1996-10-27 10:55:05 +01:00
|
|
|
|
|
|
|
# bootstrap.o's dependency on bootstrap_tokens.h is computed by the
|
|
|
|
# make depend, but we state it here explicitly anyway because
|
|
|
|
# bootstrap_tokens.h doesn't even exist at first and if user fails to
|
|
|
|
# do make depend, we still want the build to succeed.
|
|
|
|
|
|
|
|
bootstrap.o: bootstrap_tokens.h
|
|
|
|
|
|
|
|
bootstrap_tokens.h bootparse.c: bootparse.y
|
|
|
|
$(YACC) $(YFLAGS) $<
|
1997-06-11 03:05:48 +02:00
|
|
|
grep -v "^#" boot.sed > sedfile
|
|
|
|
sed -f sedfile < y.tab.c > bootparse.c
|
1996-10-27 10:55:05 +01:00
|
|
|
mv y.tab.h bootstrap_tokens.h
|
1997-06-11 03:05:48 +02:00
|
|
|
rm -f y.tab.c sedfile
|
1996-10-27 10:55:05 +01:00
|
|
|
|
|
|
|
bootscanner.c: bootscanner.l
|
|
|
|
$(LEX) $<
|
1997-06-11 03:05:48 +02:00
|
|
|
grep -v "^#" boot.sed > sedfile
|
|
|
|
sed -f sedfile < lex.yy.c > bootscanner.c
|
|
|
|
rm -f lex.yy.c sedfile
|
1996-10-27 10:55:05 +01:00
|
|
|
|
|
|
|
clean:
|
|
|
|
rm -f SUBSYS.o $(OBJS) bootparse.c bootstrap_tokens.h bootscanner.c
|
|
|
|
# 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.
|
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
|
|
|
|
|