diff options
| author | Bryan Henderson | 1996-10-27 09:55:05 +0000 |
|---|---|---|
| committer | Bryan Henderson | 1996-10-27 09:55:05 +0000 |
| commit | b0d6f0aa639610f47bed818f7bc4e584cd9a391b (patch) | |
| tree | 103835aa6881d565d6ab23d09b7784c4952d8a2b /src/backend/bootstrap | |
| parent | 1e39d14ff33f7ac436bbbd0b46a3e31faafed561 (diff) | |
Simplify make files, add full dependencies.
Diffstat (limited to 'src/backend/bootstrap')
| -rw-r--r-- | src/backend/bootstrap/Makefile | 71 | ||||
| -rw-r--r-- | src/backend/bootstrap/Makefile.inc | 63 |
2 files changed, 71 insertions, 63 deletions
diff --git a/src/backend/bootstrap/Makefile b/src/backend/bootstrap/Makefile new file mode 100644 index 00000000000..66ed86f3c52 --- /dev/null +++ b/src/backend/bootstrap/Makefile @@ -0,0 +1,71 @@ +#------------------------------------------------------------------------- +# +# Makefile-- +# Makefile for the bootstrap module +# +# IDENTIFICATION +# $Header: /cvsroot/pgsql/src/backend/bootstrap/Makefile,v 1.1 1996/10/27 09:46:59 bryanh 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 ../../Makefile.global + +INCLUDE_OPT = -I.. \ + -I../port/$(PORTNAME) \ + -I../include \ + -I../../include + +CFLAGS += $(INCLUDE_OPT) + +BOOTYACCS = bootstrap_tokens.h bootparse.c + +OBJS = bootparse.o bootscanner.o bootstrap.o + +all: SUBSYS.o + +SUBSYS.o: $(OBJS) + ld -r -o 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) $(YFLAGS) $< + sed -f boot.sed < y.tab.c > bootparse.c + mv y.tab.h bootstrap_tokens.h + rm -f y.tab.c + +bootscanner.c: bootscanner.l + $(LEX) $< + sed -f boot.sed < lex.yy.c > bootscanner.c + rm -f lex.yy.c + +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. +dep: bootparse.c bootscanner.c bootstrap_tokens.h + $(CC) -MM $(INCLUDE_OPT) *.c >depend + +ifeq (depend,$(wildcard depend)) +include depend +endif + diff --git a/src/backend/bootstrap/Makefile.inc b/src/backend/bootstrap/Makefile.inc deleted file mode 100644 index 39feb651068..00000000000 --- a/src/backend/bootstrap/Makefile.inc +++ /dev/null @@ -1,63 +0,0 @@ -#------------------------------------------------------------------------- -# -# Makefile.inc-- -# Makefile for the bootstrap module -# -# Copyright (c) 1994, Regents of the University of California -# -# -# IDENTIFICATION -# $Header: /cvsroot/pgsql/src/backend/bootstrap/Attic/Makefile.inc,v 1.2 1996/09/26 15:40:37 momjian Exp $ -# -# -# Another kinda weird Makefile.inc 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... -# -#------------------------------------------------------------------------- - -bootdir= $(CURDIR)/bootstrap -VPATH:= $(VPATH):$(bootdir) - -BOOTYACCS= bootstrap_tokens.h bootparse.c -#BOOTYACCS= bootparse.c - -SRCS_BOOTSTRAP= bootparse.c bootscanner.c bootstrap.c - -$(BOOTYACCS): bootparse.y - cd $(objdir); \ - $(YACC) $(YFLAGS) $<; \ - sed -f $(bootdir)/boot.sed < y.tab.c > bootparse.c; \ - mv y.tab.h bootstrap_tokens.h; \ - rm -f y.tab.c - -$(objdir)/bootparse.o: bootparse.c - $(cc_inobjdir) - - -bootscanner.c: bootscanner.l - cd $(objdir); \ - $(LEX) $<; \ - sed -f $(bootdir)/boot.sed < lex.yy.c > bootscanner.c; \ - rm -f lex.yy.c - -$(objdir)/bootscanner.o: bootscanner.c - $(cc_inobjdir) - - - -# -# The following insures that y.tab.h gets made as bootstrap.c -# includes it -# -bootstrap.o: $(BOOTYACCS) - -POSTGRES_DEPEND+= $(BOOTYACCS) bootscanner.c - - -CLEANFILES+= bootscanner.c $(BOOTYACCS) y.tab.h y.output - -HEADERS+= bootstrap.h - |
