From bebef95e8f355cf5eb7e3a9e10253e24817d100e Mon Sep 17 00:00:00 2001 From: Wolfgang Bangerth Date: Mon, 17 Aug 1998 13:25:59 +0000 Subject: [PATCH] Mess around a lot with the make files: do not compile right into a library but rather compile each file separately and bind them together later on. The advantage is that we can still compile in parallel and have everything in *one* single library now. By the way: make file messing is not much pleasure... Guido could do it the next time ;-) git-svn-id: https://svn.dealii.org/trunk@499 0785d39b-7218-0410-832d-ea1e28bc413d --- .../Attic/examples/convergence/Makefile | 4 +- deal.II/deal.II/Attic/examples/dof/Makefile | 6 +- .../Attic/examples/error-estimation/Makefile | 4 +- deal.II/deal.II/Attic/examples/grid/Makefile | 6 +- .../deal.II/Attic/examples/poisson/Makefile | 6 +- deal.II/deal.II/Make.global_options | 3 +- deal.II/deal.II/Makefile | 8 +- deal.II/deal.II/source/Makefile | 106 +++++++++++++----- deal.II/deal.II/source/fe/Makefile | 41 ------- deal.II/deal.II/source/grid/Makefile | 41 ------- deal.II/deal.II/source/numerics/Makefile | 41 ------- tests/big-tests/convergence/Makefile | 4 +- tests/big-tests/dof/Makefile | 6 +- tests/big-tests/error-estimation/Makefile | 4 +- tests/big-tests/grid/Makefile | 6 +- tests/big-tests/poisson/Makefile | 6 +- 16 files changed, 111 insertions(+), 181 deletions(-) delete mode 100644 deal.II/deal.II/source/fe/Makefile delete mode 100644 deal.II/deal.II/source/grid/Makefile delete mode 100644 deal.II/deal.II/source/numerics/Makefile diff --git a/deal.II/deal.II/Attic/examples/convergence/Makefile b/deal.II/deal.II/Attic/examples/convergence/Makefile index 243fe63c1c..7f36e65100 100644 --- a/deal.II/deal.II/Attic/examples/convergence/Makefile +++ b/deal.II/deal.II/Attic/examples/convergence/Makefile @@ -47,8 +47,8 @@ h-files = $(wildcard *.h) lib-h-files = $(wildcard ../../include/*/*.h) # list of libraries needed to link with -libs = ./Obj.a $(wildcard ../../lib/lib*.a) ../../../lac/lib/liblac.a -libs.g = ./Obj.g.a $(wildcard ../../lib/lib*.g.a) ../../../lac/lib/liblac.g.a +libs = ./Obj.a ../../lib/libdeal_II.a ../../../lac/lib/liblac.a +libs.g = ./Obj.g.a ../../lib/libdeal_II.g.a ../../../lac/lib/liblac.g.a # check whether we use debug mode or not diff --git a/deal.II/deal.II/Attic/examples/dof/Makefile b/deal.II/deal.II/Attic/examples/dof/Makefile index ff771ea390..68cdbcd2f7 100644 --- a/deal.II/deal.II/Attic/examples/dof/Makefile +++ b/deal.II/deal.II/Attic/examples/dof/Makefile @@ -15,7 +15,7 @@ debug-mode = on # If you want your program to be linked with extra object or library # files, specify them here: -user-libs = ../../lib/libbasic.g.a ../../lib/libgrid.g.a ../../../lac/lib/liblac.g.a ../../lib/libfe.g.a +user-libs = # To run the program, use "make run"; to give parameters to the program, # give the parameters to the following variable: @@ -47,8 +47,8 @@ h-files = $(wildcard *.h) lib-h-files = $(wildcard ../../include/*/*.h) # list of libraries needed to link with -libs = ./Obj.a $(wildcard ../../lib/lib*.a) ../../../lac/lib/liblac.a -libs.g = ./Obj.g.a $(wildcard ../../lib/lib*.g.a) ../../../lac/lib/liblac.g.a +libs = ./Obj.a ../../lib/libdeal_II.a ../../../lac/lib/liblac.a +libs.g = ./Obj.g.a ../../lib/libdeal_II.g.a ../../../lac/lib/liblac.g.a # check whether we use debug mode or not diff --git a/deal.II/deal.II/Attic/examples/error-estimation/Makefile b/deal.II/deal.II/Attic/examples/error-estimation/Makefile index c616cebd4d..1bde6b725f 100644 --- a/deal.II/deal.II/Attic/examples/error-estimation/Makefile +++ b/deal.II/deal.II/Attic/examples/error-estimation/Makefile @@ -52,8 +52,8 @@ h-files = $(wildcard *.h) lib-h-files = $(wildcard ../../include/*/*.h) # list of libraries needed to link with -libs = ./Obj.a $(wildcard ../../lib/lib*.a) ../../../lac/lib/liblac.a -libs.g = ./Obj.g.a $(wildcard ../../lib/lib*.g.a) ../../../lac/lib/liblac.g.a +libs = ./Obj.a ../../lib/libdeal_II.a ../../../lac/lib/liblac.a +libs.g = ./Obj.g.a ../../lib/libdeal_II.g.a ../../../lac/lib/liblac.g.a # check whether we use debug mode or not diff --git a/deal.II/deal.II/Attic/examples/grid/Makefile b/deal.II/deal.II/Attic/examples/grid/Makefile index 714fc3b6b6..bb293fbe40 100644 --- a/deal.II/deal.II/Attic/examples/grid/Makefile +++ b/deal.II/deal.II/Attic/examples/grid/Makefile @@ -15,7 +15,7 @@ debug-mode = on # If you want your program to be linked with extra object or library # files, specify them here: -user-libs = ../../lib/libbasic.g.a ../../lib/libgrid.g.a ../../../lac/lib/liblac.g.a ../../lib/libfe.g.a +user-libs = # To run the program, use "make run"; to give parameters to the program, # give the parameters to the following variable: @@ -47,8 +47,8 @@ h-files = $(wildcard *.h) lib-h-files = $(wildcard ../../include/*/*.h) # list of libraries needed to link with -libs = ./Obj.a $(wildcard ../../lib/lib*.a) ../../../lac/lib/liblac.a -libs.g = ./Obj.g.a $(wildcard ../../lib/lib*.g.a) ../../../lac/lib/liblac.g.a +libs = ./Obj.a ../../lib/libdeal_II.a ../../../lac/lib/liblac.a +libs.g = ./Obj.g.a ../../lib/libdeal_II.g.a ../../../lac/lib/liblac.g.a # check whether we use debug mode or not diff --git a/deal.II/deal.II/Attic/examples/poisson/Makefile b/deal.II/deal.II/Attic/examples/poisson/Makefile index 63cf522641..bb1be16d90 100644 --- a/deal.II/deal.II/Attic/examples/poisson/Makefile +++ b/deal.II/deal.II/Attic/examples/poisson/Makefile @@ -15,7 +15,7 @@ debug-mode = off # If you want your program to be linked with extra object or library # files, specify them here: -user-libs = ../../lib/libfe.g.a +user-libs = # To run the program, use "make run"; to give parameters to the program, # give the parameters to the following variable: @@ -47,8 +47,8 @@ h-files = $(wildcard *.h) lib-h-files = $(wildcard ../../include/*/*.h) # list of libraries needed to link with -libs = ./Obj.a $(wildcard ../../lib/lib*.a) ../../../lac/lib/liblac.a -libs.g = ./Obj.g.a $(wildcard ../../lib/lib*.g.a) ../../../lac/lib/liblac.g.a +libs = ./Obj.a ../../lib/libdeal_II.a ../../../lac/lib/liblac.a +libs.g = ./Obj.g.a ../../lib/libdeal_II.g.a ../../../lac/lib/liblac.g.a # check whether we use debug mode or not diff --git a/deal.II/deal.II/Make.global_options b/deal.II/deal.II/Make.global_options index e27ffc2c0e..4359aa1e80 100644 --- a/deal.II/deal.II/Make.global_options +++ b/deal.II/deal.II/Make.global_options @@ -1,5 +1,6 @@ # $Id$ -# Global options for all compilations +# Global options for all compilations (compilations in /source now +# use other options!) deal_II_dimension=2 diff --git a/deal.II/deal.II/Makefile b/deal.II/deal.II/Makefile index 6b864a0442..f802bb25be 100644 --- a/deal.II/deal.II/Makefile +++ b/deal.II/deal.II/Makefile @@ -3,8 +3,7 @@ all: deal.II doc examples -clean: examples-clean doc-clean source-clean - rm -f *~ include/*~ include/*/*~ lib/lib* +clean: lib-clean doc-clean source-clean examples-clean deal.II: @@ -16,6 +15,9 @@ doc: examples: cd examples ; make +lib-clean: + rm -f *~ include/*~ include/*/*~ lib/lib* lib/*o lib/st* + doc-clean: cd doc ; make clean @@ -29,4 +31,4 @@ source-clean: .PHONY: all deal.II doc examples -.PHONY: clean doc-clean examples-clean source-clean +.PHONY: clean lib-clean doc-clean examples-clean source-clean diff --git a/deal.II/deal.II/source/Makefile b/deal.II/deal.II/source/Makefile index 91bd10d547..48bdfd1d00 100644 --- a/deal.II/deal.II/source/Makefile +++ b/deal.II/deal.II/source/Makefile @@ -1,53 +1,103 @@ # $Id$ #this file uses many small rules to allow -# make -j4 +# make -j #on multiprocessor machines. Feel free to use this feature, #it gives you quicker compile time and annoys those FEATFLOW #people ;-) +include ../Make.global_options -all: lib.g.a lib.a -lib.g.a: libbasic.g.a libgrid.g.a libfe.g.a libnumerics.g.a -lib.a: libbasic.a libgrid.a libfe.a libnumerics.a +cc-files = $(wildcard */*.cc) +h-files = $(wildcard ../include/*/*.h) -libbasic.g.a: - @cd basic ; $(MAKE) lib.g.a +# strip subdirectories from cc file names, preprend a "../lib/" +# and change the suffix: +tmp1 = $(notdir $(cc-files)) +tmp2 = $(addprefix ../lib/, $(tmp1)) +o-files = $(tmp2:.cc=.o) +go-files = $(tmp2:.cc=.go) -libgrid.g.a: - @cd grid ; $(MAKE) lib.g.a -libfe.g.a: - @cd fe ; $(MAKE) lib.g.a +deal_II_dimension=2 -libnumerics.g.a: - @cd numerics; $(MAKE) lib.g.a +CXX = c++ +INCLUDE = -I../include -I../../lac/include \ + -I../../base/include -I../../mia/include +CXXFLAGS.g= -DDEBUG -g -Wall -W -pedantic -Wconversion \ + -Winline -Woverloaded-virtual -fno-rtti \ + $(INCLUDE) -Ddeal_II_dimension=$(deal_II_dimension) +CXXFLAGS =-O3 -Wuninitialized -finline-functions -ffast-math \ + -funroll-loops -felide-constructors -fnonnull-objects \ + -fno-rtti $(INCLUDE) \ + -Ddeal_II_dimension=$(deal_II_dimension) -libbasic.a: - @cd basic ; $(MAKE) lib.a +ifeq ($(shell uname),Linux) +CXX = /home/wolf/bin/gcc/bin/c++ +endif -libgrid.a: - @cd grid ; $(MAKE) lib.a +ifeq ($(shell uname),SunOS) +CXX = /usr/local/gcc/egcs-19980803/bin/c++ +endif -libfe.a: - @cd fe ; $(MAKE) lib.a -libnumerics.a: - @cd numerics; $(MAKE) lib.a +%.go : + @echo ============================ Compiling with debugging information: $< + @$(CXX) $(CXXFLAGS.g) -c $< -o $@ +%.o : + @echo ============================ Compiling with optimization: $< + @$(CXX) $(CXXFLAGS) -c $< -o $@ + -clean: - @cd basic ; $(MAKE) clean - @cd grid ; $(MAKE) clean - @cd fe ; $(MAKE) clean - @cd numerics; $(MAKE) clean -.PHONY: all lib.g.a lib.a clean -.PHONY: libbasic.g.a libgrid.g.a libfe.g.a libnumerics.g.a -.PHONY: libbasic.a libgrid.a libfe.a libnumerics.a +all: ../lib/libdeal_II.g.a ../lib/libdeal_II.a +../lib/libdeal_II.g.a: $(go-files) + @echo ============================ Updating library: $@ + @ar ruv $@ $(go-files) +../lib/libdeal_II.a: $(o-files) + @echo ============================ Updating library: $@ + @ar ruv $@ $(o-files) + +clean: + @cd basic ; rm -f *.o *.go *~ + @cd grid ; rm -f *.o *.go *~ + @cd fe ; rm -f *.o *.go *~ + @cd numerics; rm -f *.o *.go *~ + + + +.PHONY: all clean + + +#Rule to generate the dependency file. This file is +#automagically remade whenever needed, i.e. whenever +#one of the cc-/h-files changed. Make detects whether +#to remake this file upon inclusion at the bottom +#of this file. +# +#use perl to generate rules for the .go files as well +#as to make rules not for tria.o and the like, but +#rather for libgrid.a(tria.o) +# +#Later addition: the perl script was made to compile +#right into a library. Since this is not what we want +#anymore, but since 1) I am too lazy to change the +#script and 2) others may use the script as it was, +#we don't change the script but rather pipe its +#result through another perl script to get what we +#want. +../lib/Makefile.dep: $(cc-files) $(h-files) Makefile ../Make.global_options + @echo ============================ Remaking Makefile + @perl ../Make_dep.pl ../lib/libgrid $(INCLUDE) $(cc-files) \ + | perl -p -e 's!^.*\(.*/(.*)\):!../lib/$$1:!g;' \ + > ../lib/Makefile.dep + + +include ../lib/Makefile.dep diff --git a/deal.II/deal.II/source/fe/Makefile b/deal.II/deal.II/source/fe/Makefile deleted file mode 100644 index 963ef9ba7a..0000000000 --- a/deal.II/deal.II/source/fe/Makefile +++ /dev/null @@ -1,41 +0,0 @@ -# $Id$ - -include ../../Make.global_options - - -cc-files = $(wildcard *.cc) -o-files = $(cc-files:.cc=.o) -go-files = $(cc-files:.cc=.go) -h-files = $(wildcard ../include/*/*.h) - - -lib: lib.g.a lib.a - -lib.a: ../../lib/libfe.a($(o-files)) - -lib.g.a: ../../lib/libfe.g.a($(go-files)) - -clean: - rm -f *.o *.go *~ Makefile.dep - - - -.PHONY: lib lib.a lib.g.a clean - - -#Rule to generate the dependency file. This file is -#automagically remade whenever needed, i.e. whenever -#one of the cc-/h-files changed. Make detects whether -#to remake this file upon inclusion at the bottom -#of this file. -# -#use perl to generate rules for the .go files as well -#as to make rules not for tria.o and the like, but -#rather for libfe.a(tria.o) -Makefile.dep: $(cc-files) $(h-files) - @echo ============================ Remaking Makefile - @perl ../../Make_dep.pl ../../lib/libfe $(INCLUDE) $(cc-files) \ - > Makefile.dep - - -include Makefile.dep diff --git a/deal.II/deal.II/source/grid/Makefile b/deal.II/deal.II/source/grid/Makefile deleted file mode 100644 index 6ca726f6b6..0000000000 --- a/deal.II/deal.II/source/grid/Makefile +++ /dev/null @@ -1,41 +0,0 @@ -# $Id$ - -include ../../Make.global_options - - -cc-files = $(wildcard *.cc) -o-files = $(cc-files:.cc=.o) -go-files = $(cc-files:.cc=.go) -h-files = $(wildcard ../include/*/*.h) - - -lib: lib.g.a lib.a - -lib.a: ../../lib/libgrid.a($(o-files)) - -lib.g.a: ../../lib/libgrid.g.a($(go-files)) - -clean: - rm -f *.o *.go *~ Makefile.dep - - - -.PHONY: lib lib.a lib.g.a clean - - -#Rule to generate the dependency file. This file is -#automagically remade whenever needed, i.e. whenever -#one of the cc-/h-files changed. Make detects whether -#to remake this file upon inclusion at the bottom -#of this file. -# -#use perl to generate rules for the .go files as well -#as to make rules not for tria.o and the like, but -#rather for libgrid.a(tria.o) -Makefile.dep: $(cc-files) $(h-files) - @echo ============================ Remaking Makefile - @perl ../../Make_dep.pl ../../lib/libgrid $(INCLUDE) $(cc-files) \ - > Makefile.dep - - -include Makefile.dep diff --git a/deal.II/deal.II/source/numerics/Makefile b/deal.II/deal.II/source/numerics/Makefile deleted file mode 100644 index f39250fe62..0000000000 --- a/deal.II/deal.II/source/numerics/Makefile +++ /dev/null @@ -1,41 +0,0 @@ -# $Id$ - -include ../../Make.global_options - - -cc-files = $(wildcard *.cc) -o-files = $(cc-files:.cc=.o) -go-files = $(cc-files:.cc=.go) -h-files = $(wildcard ../include/*/*.h) - - -lib: lib.g.a lib.a - -lib.a: ../../lib/libnumerics.a($(o-files)) - -lib.g.a: ../../lib/libnumerics.g.a($(go-files)) - -clean: - rm -f *.o *.go *~ Makefile.dep - - - -.PHONY: lib lib.a lib.g.a clean - - -#Rule to generate the dependency file. This file is -#automagically remade whenever needed, i.e. whenever -#one of the cc-/h-files changed. Make detects whether -#to remake this file upon inclusion at the bottom -#of this file. -# -#use perl to generate rules for the .go files as well -#as to make rules not for tria.o and the like, but -#rather for libnumerics.a(tria.o) -Makefile.dep: $(cc-files) $(h-files) - @echo ============================ Remaking Makefile - @perl ../../Make_dep.pl ../../lib/libnumerics $(INCLUDE) $(cc-files) \ - > Makefile.dep - - -include Makefile.dep diff --git a/tests/big-tests/convergence/Makefile b/tests/big-tests/convergence/Makefile index 243fe63c1c..7f36e65100 100644 --- a/tests/big-tests/convergence/Makefile +++ b/tests/big-tests/convergence/Makefile @@ -47,8 +47,8 @@ h-files = $(wildcard *.h) lib-h-files = $(wildcard ../../include/*/*.h) # list of libraries needed to link with -libs = ./Obj.a $(wildcard ../../lib/lib*.a) ../../../lac/lib/liblac.a -libs.g = ./Obj.g.a $(wildcard ../../lib/lib*.g.a) ../../../lac/lib/liblac.g.a +libs = ./Obj.a ../../lib/libdeal_II.a ../../../lac/lib/liblac.a +libs.g = ./Obj.g.a ../../lib/libdeal_II.g.a ../../../lac/lib/liblac.g.a # check whether we use debug mode or not diff --git a/tests/big-tests/dof/Makefile b/tests/big-tests/dof/Makefile index ff771ea390..68cdbcd2f7 100644 --- a/tests/big-tests/dof/Makefile +++ b/tests/big-tests/dof/Makefile @@ -15,7 +15,7 @@ debug-mode = on # If you want your program to be linked with extra object or library # files, specify them here: -user-libs = ../../lib/libbasic.g.a ../../lib/libgrid.g.a ../../../lac/lib/liblac.g.a ../../lib/libfe.g.a +user-libs = # To run the program, use "make run"; to give parameters to the program, # give the parameters to the following variable: @@ -47,8 +47,8 @@ h-files = $(wildcard *.h) lib-h-files = $(wildcard ../../include/*/*.h) # list of libraries needed to link with -libs = ./Obj.a $(wildcard ../../lib/lib*.a) ../../../lac/lib/liblac.a -libs.g = ./Obj.g.a $(wildcard ../../lib/lib*.g.a) ../../../lac/lib/liblac.g.a +libs = ./Obj.a ../../lib/libdeal_II.a ../../../lac/lib/liblac.a +libs.g = ./Obj.g.a ../../lib/libdeal_II.g.a ../../../lac/lib/liblac.g.a # check whether we use debug mode or not diff --git a/tests/big-tests/error-estimation/Makefile b/tests/big-tests/error-estimation/Makefile index c616cebd4d..1bde6b725f 100644 --- a/tests/big-tests/error-estimation/Makefile +++ b/tests/big-tests/error-estimation/Makefile @@ -52,8 +52,8 @@ h-files = $(wildcard *.h) lib-h-files = $(wildcard ../../include/*/*.h) # list of libraries needed to link with -libs = ./Obj.a $(wildcard ../../lib/lib*.a) ../../../lac/lib/liblac.a -libs.g = ./Obj.g.a $(wildcard ../../lib/lib*.g.a) ../../../lac/lib/liblac.g.a +libs = ./Obj.a ../../lib/libdeal_II.a ../../../lac/lib/liblac.a +libs.g = ./Obj.g.a ../../lib/libdeal_II.g.a ../../../lac/lib/liblac.g.a # check whether we use debug mode or not diff --git a/tests/big-tests/grid/Makefile b/tests/big-tests/grid/Makefile index 714fc3b6b6..bb293fbe40 100644 --- a/tests/big-tests/grid/Makefile +++ b/tests/big-tests/grid/Makefile @@ -15,7 +15,7 @@ debug-mode = on # If you want your program to be linked with extra object or library # files, specify them here: -user-libs = ../../lib/libbasic.g.a ../../lib/libgrid.g.a ../../../lac/lib/liblac.g.a ../../lib/libfe.g.a +user-libs = # To run the program, use "make run"; to give parameters to the program, # give the parameters to the following variable: @@ -47,8 +47,8 @@ h-files = $(wildcard *.h) lib-h-files = $(wildcard ../../include/*/*.h) # list of libraries needed to link with -libs = ./Obj.a $(wildcard ../../lib/lib*.a) ../../../lac/lib/liblac.a -libs.g = ./Obj.g.a $(wildcard ../../lib/lib*.g.a) ../../../lac/lib/liblac.g.a +libs = ./Obj.a ../../lib/libdeal_II.a ../../../lac/lib/liblac.a +libs.g = ./Obj.g.a ../../lib/libdeal_II.g.a ../../../lac/lib/liblac.g.a # check whether we use debug mode or not diff --git a/tests/big-tests/poisson/Makefile b/tests/big-tests/poisson/Makefile index 63cf522641..bb1be16d90 100644 --- a/tests/big-tests/poisson/Makefile +++ b/tests/big-tests/poisson/Makefile @@ -15,7 +15,7 @@ debug-mode = off # If you want your program to be linked with extra object or library # files, specify them here: -user-libs = ../../lib/libfe.g.a +user-libs = # To run the program, use "make run"; to give parameters to the program, # give the parameters to the following variable: @@ -47,8 +47,8 @@ h-files = $(wildcard *.h) lib-h-files = $(wildcard ../../include/*/*.h) # list of libraries needed to link with -libs = ./Obj.a $(wildcard ../../lib/lib*.a) ../../../lac/lib/liblac.a -libs.g = ./Obj.g.a $(wildcard ../../lib/lib*.g.a) ../../../lac/lib/liblac.g.a +libs = ./Obj.a ../../lib/libdeal_II.a ../../../lac/lib/liblac.a +libs.g = ./Obj.g.a ../../lib/libdeal_II.g.a ../../../lac/lib/liblac.g.a # check whether we use debug mode or not -- 2.39.5