Files
postgres/src/backend/bootstrap/Makefile
Peter Eisentraut f03fc94e7d New configure test for flex, which recognizes only flex but does so in all
incarnations (I hope). When an acceptable flex version is not found, print
instructive error messages from both configure and the makefiles, so that
users can continue building anyway.
2000-08-28 11:53:23 +00:00

73 lines
1.8 KiB
Makefile

#-------------------------------------------------------------------------
#
# Makefile for the bootstrap module
#
# $Header: /cvsroot/pgsql/src/backend/bootstrap/Makefile,v 1.25 2000/08/28 11:53:17 petere Exp $
#
#-------------------------------------------------------------------------
subdir = src/backend/bootstrap
top_builddir = ../../..
include $(top_builddir)/src/Makefile.global
ifeq ($(GCC), yes)
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