From: wolf Date: Wed, 3 Feb 1999 09:23:18 +0000 (+0000) Subject: Make the Makefile truely multidimension aware. X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c950a2d7a36c5438fc3392c3cdca1a9d0b077522;p=dealii-svn.git Make the Makefile truely multidimension aware. git-svn-id: https://svn.dealii.org/trunk@752 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/deal.II/source/Makefile b/deal.II/deal.II/source/Makefile index 60401be188..e8c0f1440f 100644 --- a/deal.II/deal.II/source/Makefile +++ b/deal.II/deal.II/source/Makefile @@ -10,7 +10,6 @@ #I think I have removed any non-supported cross-references, so you #should be able to compile with an arbitrary number of processes. -deal_II_dimension=2 cc-files = $(wildcard */*.cc) @@ -22,9 +21,13 @@ h-files = $(wildcard ../include/*/*.h) # -frepo switch to gcc; this, however, creates a .rpo file which # would be the same for both debug and non-debug versions, if we # don't care about different directories -tmp1 = $(notdir $(cc-files)) -o-files = $(addprefix ../lib/$(deal_II_dimension)d/o/, $(tmp1:.cc=_$(deal_II_dimension)d.o) ) -go-files = $(addprefix ../lib/$(deal_II_dimension)d/go/, $(tmp1:.cc=_$(deal_II_dimension)d.go)) +tmp1 = $(notdir $(cc-files)) +o-files-1d = $(addprefix ../lib/1d/o/, $(tmp1:.cc=_1d.o) ) +go-files-1d = $(addprefix ../lib/1d/go/, $(tmp1:.cc=_1d.go)) +o-files-2d = $(addprefix ../lib/2d/o/, $(tmp1:.cc=_2d.o) ) +go-files-2d = $(addprefix ../lib/2d/go/, $(tmp1:.cc=_2d.go)) +o-files-3d = $(addprefix ../lib/3d/o/, $(tmp1:.cc=_3d.o) ) +go-files-3d = $(addprefix ../lib/3d/go/, $(tmp1:.cc=_3d.go)) CXX = c++ @@ -32,33 +35,66 @@ INCLUDE = -I../include -I../../lac/include \ -I../../base/include -I../../mia/include CXXFLAGS.g= -DDEBUG -g -Wall -W -pedantic -Wconversion \ -Winline -Woverloaded-virtual \ - $(INCLUDE) -Ddeal_II_dimension=$(deal_II_dimension) + $(INCLUDE) CXXFLAGS =-O3 -Wuninitialized -finline-functions -ffast-math \ -felide-constructors -fnonnull-objects \ - $(INCLUDE) \ - -Ddeal_II_dimension=$(deal_II_dimension) + $(INCLUDE) -%.go : - @echo ==============$(deal_II_dimension)d======debug============= $< - @$(CXX) $(CXXFLAGS.g) -c $< -o $@ -%.o : - @echo ==============$(deal_II_dimension)d======optimized========= $< - @$(CXX) $(CXXFLAGS) -c $< -o $@ +../lib/1d/go/%.go : + @echo ==============1d======debug============= $< + @$(CXX) $(CXXFLAGS.g) -Ddeal_II_dimension=1 -c $< -o $@ +../lib/1d/o/%.o : + @echo ==============1d======optimized========= $< + @$(CXX) $(CXXFLAGS) -Ddeal_II_dimension=1 -c $< -o $@ +../lib/2d/go/%.go : + @echo ==============2d======debug============= $< + @$(CXX) $(CXXFLAGS.g) -Ddeal_II_dimension=2 -c $< -o $@ +../lib/2d/o/%.o : + @echo ==============2d======optimized========= $< + @$(CXX) $(CXXFLAGS) -Ddeal_II_dimension=2 -c $< -o $@ +../lib/3d/go/%.go : + @echo ==============3d======debug============= $< + @$(CXX) $(CXXFLAGS.g) -Ddeal_II_dimension=3 -c $< -o $@ +../lib/3d/o/%.o : + @echo ==============3d======optimized========= $< + @$(CXX) $(CXXFLAGS) -Ddeal_II_dimension=3 -c $< -o $@ -all: ../lib/libdeal_II.g.a ../lib/libdeal_II.a +default: 2d +all: 1d 2d 3d -../lib/libdeal_II.g.a: $(go-files) - @echo ============================ Updating library: $@ - @ar ruv $@ $(go-files) +1d: ../lib/libdeal_II_1d.g.a ../lib/libdeal_II_1d.a -../lib/libdeal_II.a: $(o-files) - @echo ============================ Updating library: $@ - @ar ruv $@ $(o-files) +2d: ../lib/libdeal_II_2d.g.a ../lib/libdeal_II_2d.a + +3d: ../lib/libdeal_II_3d.g.a ../lib/libdeal_II_3d.a + + + +../lib/libdeal_II_1d.g.a: $(go-files-1d) + @echo ======================================== Updating library: $@ + @ar ruv $@ $(go-files-1d) +../lib/libdeal_II_1d.a: $(o-files-1d) + @echo ======================================== Updating library: $@ + @ar ruv $@ $(o-files-1d) + +../lib/libdeal_II_2d.g.a: $(go-files-2d) + @echo ======================================== Updating library: $@ + @ar ruv $@ $(go-files-2d) +../lib/libdeal_II_2d.a: $(o-files-2d) + @echo ======================================== Updating library: $@ + @ar ruv $@ $(o-files-2d) + +../lib/libdeal_II_3d.g.a: $(go-files-3d) + @echo ======================================== Updating library: $@ + @ar ruv $@ $(go-files-3d) +../lib/libdeal_II_3d.a: $(o-files-3d) + @echo ======================================== Updating library: $@ + @ar ruv $@ $(o-files-3d) clean: @@ -69,7 +105,7 @@ clean: -.PHONY: all clean +.PHONY: default 1d 2d 3d all clean #Rule to generate the dependency file. This file is @@ -96,20 +132,20 @@ clean: #programs which use the 2d *and* the 3d library; #if the files within these libraries had the same names, #we may get into trouble. -../lib/Makefile_$(deal_II_dimension)d.dep: $(cc-files) $(h-files) Makefile ../Make.global_options +../lib/Makefile.dep: $(cc-files) $(h-files) Makefile ../Make.global_options @echo ============================ Remaking Makefile @echo "# This Makefile was automatically generated by ../source/Makefile" \ > ../lib/Makefile.dep @echo "# See there for more information." >> ../lib/Makefile.dep @perl ../Make_dep.pl ../lib/libgrid $(INCLUDE) $(cc-files) \ - | perl -p -e 's!^.*\(.*/(.*)\):!../lib/$(deal_II_dimension)d/$$1:!g;' \ + | perl -p -e 's!^.*\(.*/(.*)\):!../lib/DIM_PLACEHOLDER/$$1:!g;' \ | perl -pe 's!(/[^/]+\.(o|go)):!/$$2$$1:!g;' \ - | perl -pe 's!(\.g?o)!_$(deal_II_dimension)d$$1!g;' \ - >> ../lib/Makefile_$(deal_II_dimension)d.dep + | perl -pe 's!(\.g?o)!_DIM_PLACEHOLDER$$1!g;' \ + | perl -pe 's!^\.\./lib/DIM_PLACEHOLDER/(.*):!../lib/1d/$$1 ../lib/2d/$$1 ../lib/3d/$$1:!g;' \ + | perl -pe 's!(\.\./lib/1d/[^ ]+)_DIM_PLACEHOLDER!$$1_1d!g;' \ + | perl -pe 's!(\.\./lib/2d/[^ ]+)_DIM_PLACEHOLDER!$$1_2d!g;' \ + | perl -pe 's!(\.\./lib/3d/[^ ]+)_DIM_PLACEHOLDER!$$1_3d!g;' \ + >> ../lib/Makefile.dep -#include the dependency file if a dimension was specified. If not, we -#don't start a compiler run, so we need not include dependencies anyway. -ifneq "$(deal_II_dimension)" "" -include ../lib/Makefile_$(deal_II_dimension)d.dep -endif +include ../lib/Makefile.dep