From 9d3b9ed3aed7f60cf60286e9df3c86463c1798f4 Mon Sep 17 00:00:00 2001 From: skywalker Date: Wed, 1 Aug 2001 04:18:37 +0000 Subject: [PATCH] More simple changes to move to new make format --- src/fbutil/FirebirdConfig.cpp | 3 +-- src/make.new/Makefile.in.alice | 4 ++-- src/make.new/Makefile.in.dsql | 25 ++++++++++++++-------- src/make.new/Makefile.in.fbutil | 4 ++-- src/make.new/Makefile.in.gpre | 14 +++++++++++-- src/make.new/Makefile.in.jrd | 33 ++++++++++++++++++------------ src/make.new/Makefile.in.lock | 4 ++-- src/make.new/Makefile.in.pipe | 4 ++-- src/make.new/Makefile.in.remote | 4 ++-- src/make.new/Makefile.in.utilities | 12 +++++++---- src/make.new/Makefile.in.wal | 4 ++-- src/make.new/make.defaults | 7 ++++--- src/make.new/make.rules | 26 +++++++++++++++++++---- 13 files changed, 95 insertions(+), 49 deletions(-) diff --git a/src/fbutil/FirebirdConfig.cpp b/src/fbutil/FirebirdConfig.cpp index a4b971744e..aac8678b75 100644 --- a/src/fbutil/FirebirdConfig.cpp +++ b/src/fbutil/FirebirdConfig.cpp @@ -1,7 +1,6 @@ +#include "firebird.h" #include "FirebirdConfig.h" -#include "fred.h" - #ifdef HAVE_STDLIB_H #include #endif diff --git a/src/make.new/Makefile.in.alice b/src/make.new/Makefile.in.alice index 0248e7636b..0ea4eb1f29 100644 --- a/src/make.new/Makefile.in.alice +++ b/src/make.new/Makefile.in.alice @@ -26,7 +26,7 @@ # Contributor(s): # # -# $Id: Makefile.in.alice,v 1.2 2001-07-31 18:34:05 skywalker Exp $ +# $Id: Makefile.in.alice,v 1.3 2001-08-01 04:18:37 skywalker Exp $ # ROOT=../.. @@ -68,5 +68,5 @@ yachts.lnk: ln -fs ../refDatabases/empty.gdb yachts.lnk -include $(Dependencies) +-include $(Dependencies) diff --git a/src/make.new/Makefile.in.dsql b/src/make.new/Makefile.in.dsql index ca481241bd..38ebe7f3eb 100644 --- a/src/make.new/Makefile.in.dsql +++ b/src/make.new/Makefile.in.dsql @@ -26,7 +26,7 @@ # Contributor(s): # # -# $Id: Makefile.in.dsql,v 1.1 2001-07-29 23:43:23 skywalker Exp $ +# $Id: Makefile.in.dsql,v 1.2 2001-08-01 04:18:37 skywalker Exp $ # ROOT=../.. @@ -39,6 +39,19 @@ include $(ROOT)/src/make.shared.variables @SET_MAKE@ +# Overwrite the GPRE_FLAGS to allow for building using boot gpre compiler + +GPRE_FLAGS= -lang_internal -r -m -z -n + + + + +AllObjects = $(DSQL_Objects) + +Dependencies = $(AllObjects:.o=.d) + + + .PHONY: jrd_static jrd_static : $(LIB)/jrd_static.a($(DSQL_Objects)) @@ -58,10 +71,7 @@ jrdlib_dependencies: $(DSQL_Objects) -#DSQL_P_OBJECTS= alld.bin array.bin blob.bin ddl.bin dsql.bin \ -# errd.bin gen.bin hsh.bin make.bin metd.bin \ -# movd.bin parse.bin pass1.bin preparse.bin \ -# user_dsql.bin utld.bin +#___ left to help resolve super server___________________________________ DSQL_J_OBJECTS= array.j blob.j preparse.j user_dsql.j utld.j @@ -79,7 +89,4 @@ parse.cpp: parse.sed y.tab.c sed -f $< y.tab.c > $@ # -$(RM) y.tab.c - -Dependencies = $(DSQL_Objects:.o=.d) - -include $(Dependencies) +-include $(Dependencies) diff --git a/src/make.new/Makefile.in.fbutil b/src/make.new/Makefile.in.fbutil index 196684ed0f..236cd8f0ea 100755 --- a/src/make.new/Makefile.in.fbutil +++ b/src/make.new/Makefile.in.fbutil @@ -26,7 +26,7 @@ # Contributor(s): # # -# $Id: Makefile.in.fbutil,v 1.1 2001-07-31 18:34:05 skywalker Exp $ +# $Id: Makefile.in.fbutil,v 1.2 2001-08-01 04:18:37 skywalker Exp $ # ROOT=../.. @@ -68,5 +68,5 @@ clean: -rm $(Dependancies) -include $(Dependancies) +-include $(Dependancies) diff --git a/src/make.new/Makefile.in.gpre b/src/make.new/Makefile.in.gpre index a9d52e5e61..c2f59b6664 100644 --- a/src/make.new/Makefile.in.gpre +++ b/src/make.new/Makefile.in.gpre @@ -26,7 +26,7 @@ # Contributor(s): # # -# $Id: Makefile.in.gpre,v 1.2 2001-07-31 18:34:05 skywalker Exp $ +# $Id: Makefile.in.gpre,v 1.3 2001-08-01 04:18:37 skywalker Exp $ # ROOT=../.. @@ -64,6 +64,10 @@ Dependencies = $(AllObjects:.o=.d) .PHONY: gpre_boot gpre_static gpre +# As we build each of the gpre targets we change the link in $(GPRE_CURRENT) +# to point to the latest one, that way the .epp.cpp rule is kept simple +# and we always end up using the correct one at each bootstrap stage. + gpre_boot : $(GPRE_BOOT) gpre_static : $(GPRE_STATIC) @@ -73,11 +77,15 @@ gpre : $(GPRE) $(GPRE_BOOT): $(GPRECommon_Objects) $(GPREBoot_Objects) $(LIB)/jrd_boot.a $(STATICEXE_LINK) -o $(GPRE_BOOT) $(DARWIN_FOUNDATION_LINK) $^ $(STATICLINK_LIBS) + -$(RM) $(GPRE_CURRENT) + $(LN) $(@F) $(GPRE_CURRENT) $(GPRE_STATIC):$(GPRECommon_Objects) $(GPRE_Objects) $(LIB)/jrd_static.a $(STATICEXE_LINK) $(LINK_OPTS) $^ $(COREFOUNDATION_LINK) -o $@ $(STATICLINK_LIBS) $(CHMOD_7) $@ + -$(RM) $(GPRE_CURRENT) + $(LN) $(@F) $(GPRE_CURRENT) # DARWIN - COREFOUNDATION_LINK should go into darwin link opts or libs. @@ -85,6 +93,8 @@ $(GPRE_STATIC):$(GPRECommon_Objects) $(GPRE_Objects) $(LIB)/jrd_static.a $(GPRE):$(GPRECommon_Objects) $(GPRE_Objects) $(LIBGDS_LA) $(EXE_LINK) $(LINK_OPTS) $^ $(COREFOUNDATION_LINK) -o $@ $(LINK_LIBS) $(CHMOD_7) $@ + -$(RM) $(GPRE_CURRENT) + $(LN) $(@F) $(GPRE_CURRENT) @@ -102,4 +112,4 @@ $(SRC)/gpre_meta.cpp: $(SRC)/gpre_meta.epp jrdlib_dependencies: $(GPRELIB_Objects) -include $(Dependencies) +-include $(Dependencies) diff --git a/src/make.new/Makefile.in.jrd b/src/make.new/Makefile.in.jrd index bb6bfe2c9a..23fd7cd205 100644 --- a/src/make.new/Makefile.in.jrd +++ b/src/make.new/Makefile.in.jrd @@ -26,7 +26,7 @@ # Contributor(s): # # -# $Id: Makefile.in.jrd,v 1.2 2001-07-31 18:34:05 skywalker Exp $ +# $Id: Makefile.in.jrd,v 1.3 2001-08-01 04:18:37 skywalker Exp $ # ROOT=../.. @@ -45,11 +45,11 @@ include $(ROOT)/src/make.shared.variables GPRE_FLAGS = -n -z -gds_cxx -raw -ids -.e.c: - $(GPRE_BOOT) $(GPRE_FLAGS) $< $@ - -.epp.cpp: - $(GPRE_BOOT) $(GPRE_FLAGS) $< $@ +#.e.c: +# $(GPRE_BOOT) $(GPRE_FLAGS) $< $@ +# +#.epp.cpp: +# $(GPRE_BOOT) $(GPRE_FLAGS) $< $@ @@ -765,11 +765,17 @@ iscb.bin: isc.cpp # script is run to remove a component of it. This is pretty ugly, and even # if we have to live with it, the makefile should be changed to make the # dependencies clearer. -dyn_def.o: dyn_def.cpp dyn_def.sed - sed -f dyn_def.sed $< > dyn_deffoo.cpp - $(CXX) -c $(CFLAGS) $(CXX_INCLUDE_DIRS) $(VERSION_FLAG) dyn_deffoo.cpp - $(MV) dyn_deffoo.o dyn_def.bin - -$(RM) dyn_deffoo.cpp dyn_deffoo.o + +$(SRC)/dyn_def.cpp : $(SRC)/dyn_def.epp $(SRC)/dyn_def.sed + $(GPRE_BOOT) $(GPRE_FLAGS) $< $(GEN_SRC)/dyn_deffoo.cpp + sed -f $(SRC)/dyn_def.sed $(GEN_SRC)/dyn_deffoo.cpp > $@ + +# This was the old dependancies. +#$(BIN)/dyn_def.o: $(SRC)/dyn_def.cpp $(SRC)/dyn_def.sed +# sed -f dyn_def.sed $< > dyn_deffoo.cpp +# $(CXX) -c $(CFLAGS) $(CXX_INCLUDE_DIRS) $(VERSION_FLAG) dyn_deffoo.cpp +# $(MV) dyn_deffoo.o dyn_def.bin +# -$(RM) dyn_deffoo.cpp dyn_deffoo.o flu_non_dl.bin: flu.cpp @@ -781,7 +787,8 @@ head5.bin: head.cpp $(CXX) -c $(PIC_FLAGS) $(CXX_INCLUDE_DIRS) $(VERSION_FLAG) -DGDS_PIPE=\"bin/gds_pipe5\" $< -o $@ +AllObjects = $(BOOT_Objects) $(JRD_Objects) -Dependencies = $(BOOT_Objects:.o=.d) $(JRD_Objects:.o=.d) +Dependencies = $(AllObjects:.o=.d) -include $(Dependencies) +-include $(Dependencies) \ No newline at end of file diff --git a/src/make.new/Makefile.in.lock b/src/make.new/Makefile.in.lock index 8a33fa6421..a9db77c859 100644 --- a/src/make.new/Makefile.in.lock +++ b/src/make.new/Makefile.in.lock @@ -26,7 +26,7 @@ # Contributor(s): # # -# $Id: Makefile.in.lock,v 1.1 2001-07-29 23:43:23 skywalker Exp $ +# $Id: Makefile.in.lock,v 1.2 2001-08-01 04:18:37 skywalker Exp $ # ROOT=../.. @@ -137,4 +137,4 @@ $(BIN)/lock_driver: $(LOCKDRIVER_OBJECTS) $(LIBGDS_LA) $(CHMOD_S7) $@ -include $(Dependencies) +-include $(Dependencies) diff --git a/src/make.new/Makefile.in.pipe b/src/make.new/Makefile.in.pipe index bacb9befcd..7b4879e587 100644 --- a/src/make.new/Makefile.in.pipe +++ b/src/make.new/Makefile.in.pipe @@ -26,7 +26,7 @@ # Contributor(s): # # -# $Id: Makefile.in.pipe,v 1.1 2001-07-29 23:43:23 skywalker Exp $ +# $Id: Makefile.in.pipe,v 1.2 2001-08-01 04:18:37 skywalker Exp $ # ROOT=../.. @@ -72,4 +72,4 @@ jrdlib_dependencies: $(PIPE_Objects) -include $(Dependencies) +-include $(Dependencies) diff --git a/src/make.new/Makefile.in.remote b/src/make.new/Makefile.in.remote index 5cfebc9eb6..620c034055 100644 --- a/src/make.new/Makefile.in.remote +++ b/src/make.new/Makefile.in.remote @@ -26,7 +26,7 @@ # Contributor(s): # # -# $Id: Makefile.in.remote,v 1.2 2001-07-31 18:34:05 skywalker Exp $ +# $Id: Makefile.in.remote,v 1.3 2001-08-01 04:18:37 skywalker Exp $ # ROOT=../.. @@ -309,4 +309,4 @@ force: merge.j: merge.o -include $(Dependencies) +-include $(Dependencies) diff --git a/src/make.new/Makefile.in.utilities b/src/make.new/Makefile.in.utilities index 417bc897d4..b0ad8fd197 100644 --- a/src/make.new/Makefile.in.utilities +++ b/src/make.new/Makefile.in.utilities @@ -26,7 +26,7 @@ # Contributor(s): # # -# $Id: Makefile.in.utilities,v 1.2 2001-07-31 18:34:05 skywalker Exp $ +# $Id: Makefile.in.utilities,v 1.3 2001-08-01 04:18:37 skywalker Exp $ # ROOT=../.. @@ -233,9 +233,12 @@ $(GDS_RELAY): $(RELAY_Objects) $(LIBGDS_LA) $(CHMOD_7) $@ -dba.cpp: yachts.lnk dba.epp +# Eventually this one wants to be a $(GEN_SRC)/dba.cpp + +$(SRC)/dba.cpp: yachts.lnk $(SRC)/dba.epp + yachts.lnk: - ln -fs $(SRC)/refDatabases/empty.gdb yachts.lnk + ln -fs $(SRC_ROOT)/refDatabases/empty.gdb yachts.lnk # I was hoping one of these was going to allow me to compile security.epp @@ -246,6 +249,7 @@ yachts.lnk: #security.cpp: security.epp # $(GPRE) -n -manual -raw -strings $< $@ # $(GPRE) -n -gds_cxx -raw -ids $< $@ +# -lang_internal @@ -265,4 +269,4 @@ install_svc.exe: install_svc.o services.o $(RM) install_svc.exe $(TOUCH) install_svc.exe -include $(Dependencies) +-include $(Dependencies) diff --git a/src/make.new/Makefile.in.wal b/src/make.new/Makefile.in.wal index 1f35bcff24..f19a64b147 100644 --- a/src/make.new/Makefile.in.wal +++ b/src/make.new/Makefile.in.wal @@ -26,7 +26,7 @@ # Contributor(s): # # -# $Id: Makefile.in.wal,v 1.1 2001-07-29 23:43:23 skywalker Exp $ +# $Id: Makefile.in.wal,v 1.2 2001-08-01 04:18:37 skywalker Exp $ # ROOT=../.. @@ -137,5 +137,5 @@ driver.exe: driver.o $(WAL_OBJECTS) $(JRD_OBJECTS) $(OBJS)/jrd/thd.o $(RM) wal.rsp -include $(Dependencies) +-include $(Dependencies) diff --git a/src/make.new/make.defaults b/src/make.new/make.defaults index 9b7e48ac97..4519f90d0e 100755 --- a/src/make.new/make.defaults +++ b/src/make.new/make.defaults @@ -26,7 +26,7 @@ # Contributor(s): # # -# $Id: make.defaults,v 1.1 2001-07-29 23:43:23 skywalker Exp $ +# $Id: make.defaults,v 1.2 2001-08-01 04:18:37 skywalker Exp $ # @@ -60,7 +60,7 @@ QUIET_ECHO= @echo CD= cd CAT= cat AR= ar crsu - +LN= ln -s # Default extensions @@ -119,10 +119,11 @@ GBAK_STATIC = $(BIN)/gbak_static$(EXEC_EXT) GBAK = $(BIN)/gbak$(EXEC_EXT) # From gpre +# (gpre current is a link to one of the others) GPRE_BOOT = $(BIN)/gpre_boot$(EXEC_EXT) GPRE_STATIC = $(BIN)/gpre_static$(EXEC_EXT) GPRE = $(BIN)/gpre$(EXEC_EXT) - +GPRE_CURRENT = $(BIN)/gpre_current$(EXEC_EXT) # From intl LIBGDSINTL_LA = $(FIREBIRD)/intl/libgdsintl.so diff --git a/src/make.new/make.rules b/src/make.new/make.rules index 0cdc8d4019..149b343a85 100644 --- a/src/make.new/make.rules +++ b/src/make.new/make.rules @@ -26,7 +26,7 @@ # Contributor(s): # # -# $Id: make.rules,v 1.2 2001-07-31 18:34:05 skywalker Exp $ +# $Id: make.rules,v 1.3 2001-08-01 04:18:37 skywalker Exp $ # #____________________________________________________________________________ @@ -64,7 +64,10 @@ SRC=$(SRC_ROOT)/$(ModuleName) OBJ=$(GEN_ROOT)/$(ModuleName) DEP=$(OBJ) -GEN_SRC=$(SRC) # I would like to change this into generated area. +GEN_SRC=$(OBJ) + + # This one is not so widely used at the momement. + # but I would like it to become so. FIREBIRD=$(GEN_ROOT)/firebird @@ -154,16 +157,31 @@ endif # Here we have definitions for using the preprocessor. +# The GPRE_FLAGS is overwritten in Makefile.in.jrd Makefile.in.gpre and +# since they do something extra to allow the boot build to work. +# +# One other point is that sometimes a failure in compile with gpre does not +# result in an error being generated. The generated source file still +# compiles and throws the make off the path. +# +# This bit of code is part of unfinished bit to let make determine if +# gpre gpre_static or gpre_boot should be used based on which ones exist. +# +# testgpre = $(shell if [ -f $(GPRE) ]; then; echo $(GPRE); else; echo ""; fi) +#test1: +# echo $(testgpre) + + GPRE_FLAGS= -r -m -z -n .SUFFIXES: .c .e .epp .cpp .e.c: - $(GPRE_STATIC) $(GPRE_FLAGS) $< $@ + $(GPRE_CURRENT) $(GPRE_FLAGS) $< $@ .epp.cpp: - $(GPRE_STATIC) $(GPRE_FLAGS) $< $@ + $(GPRE_CURRENT) $(GPRE_FLAGS) $< $@