postgresql/src/backend/bootstrap/Makefile
Peter Eisentraut e3059fc0f5 Gen_fmgrtab.sh is strange: it is a platform dependent way (because it uses
CPP) to create platform independent files. Unfortunately, that means that
every config.status (or configure) run invariably causes a relink of the
postmaster and also that we can't put these files in the distribution
(usefully). So we make it a little smarter: when the output files already
exist and it notices that it would recreate them in identical form, it
doesn't touch them. In order to avoid re-running the make rule all the time
we update a timestamp file instead.

Update release_prep accordingly. Also make Gen_fmgrtab.sh use the awk that
is detected at configure time, not necessarily named `awk' and have it check
for exit statuses a little better.

In other news... Remove USE_LOCALE from the templates, it was set to `no'
everywhere anyway. Also remove YACC and YFLAGS from the templates, configure
is smart enough to find bison or yacc itself. Use AC_PROG_YACC for that
instead of the hand-crafted code. Do not set YFLAGS to `-d'. The make rules
that need this flag should explicitly invoke it. YFLAGS should be a user
variable. Update the makefiles to that effect.
2000-06-07 16:27:00 +00:00

75 lines
2.1 KiB
Makefile

#-------------------------------------------------------------------------
#
# Makefile--
# Makefile for the bootstrap module
#
# IDENTIFICATION
# $Header: /cvsroot/pgsql/src/backend/bootstrap/Makefile,v 1.23 2000/06/07 16:26:37 petere Exp $
#
#
# 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...
#
#-------------------------------------------------------------------------
SRCDIR= ../..
include $(SRCDIR)/Makefile.global
ifeq ($(CC), gcc)
CFLAGS+= -Wno-error
endif
BOOTYACCS= bootstrap_tokens.h bootparse.c
ifneq ($(PORTNAME), qnx4)
OBJS= bootparse.o bootscanner.o bootstrap.o
else
# qnx4's wlink currently crashes with bootstrap.o
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) SUBSYS.o $(OBJS)
# 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) -d $(YFLAGS) $<
grep -v "^#" boot.sed > sedfile
sed -f sedfile < y.tab.c > bootparse.c
mv y.tab.h bootstrap_tokens.h
rm -f y.tab.c sedfile
bootscanner.c: bootscanner.l
$(LEX) $(LFLAGS) $<
grep -v "^#" boot.sed > sedfile
sed -f sedfile < lex.yy.c > bootscanner.c
rm -f lex.yy.c sedfile
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