From e9d33717f67cd086af13b8b00ccd95778b7ec453 Mon Sep 17 00:00:00 2001 From: guido Date: Thu, 22 Apr 1999 11:48:26 +0000 Subject: [PATCH] Initial revision git-svn-id: https://svn.dealii.org/trunk@1196 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/common/Make.global_options | 32 ++++++++++ deal.II/common/Makefile.template | 97 ++++++++++++++++++++++++++++++ 2 files changed, 129 insertions(+) create mode 100644 deal.II/common/Make.global_options create mode 100644 deal.II/common/Makefile.template diff --git a/deal.II/common/Make.global_options b/deal.II/common/Make.global_options new file mode 100644 index 0000000000..39b4197139 --- /dev/null +++ b/deal.II/common/Make.global_options @@ -0,0 +1,32 @@ +# $Id$ +# Copyright W. Bangerth, G. Kanschat, University of Heidelberg, 1998, 1999 + +# This file uses the variable $D, which is the deal home directory, +# that is, the parent directory of this directory. +# +# Please set $D to the right path before including this file! + +vpath %.a $D/base/lib +vpath %.a $D/lac/lib +vpath %.a $D/deal.II/lib + +CXX = c++ +INCLUDE = -I$D/deal.II/include -I$D/lac/include \ + -I$D/base/include +CXXFLAGS.g= -ansi -DDEBUG -ggdb -Wall -W -pedantic -Wconversion \ + -Winline -Woverloaded-virtual -fno-builtin\ + -fno-vtable-thunks \ + $(INCLUDE) +CXXFLAGS.o= -O2 -Wuninitialized -ffast-math \ + -felide-constructors -fnonnull-objects \ + -fno-vtable-thunks \ + $(INCLUDE) + + + +%.go : %.cc #Makefile + @echo =====debug========= $< + @$(CXX) $(flags) -c $< -o $@ +%.o : %.cc #Makefile + @echo =====optimized===== $< + @$(CXX) $(flags) -c $< -o $@ diff --git a/deal.II/common/Makefile.template b/deal.II/common/Makefile.template new file mode 100644 index 0000000000..5647da35d1 --- /dev/null +++ b/deal.II/common/Makefile.template @@ -0,0 +1,97 @@ +############################################################ +# Directory with the DEAL distribution +############################################################ + +D = please/enter/here/path/to/newdeal + + +############################################################ +# Include general settings for including DEAL libraries +############################################################ + +include $D/common/Make.global_options + + +############################################################ +# Set debug-mode as a default +############################################################ + +debug-mode = on + + +############################################################ +# Define library names +############################################################ + +libs = -ldeal_II_2d -llac -lbase +libs.g = -ldeal_II_2d.g -llac.g -lbase.g + + +############################################################ +# Select compiler flags according to debug-mode +############################################################ + +ifeq ($(debug-mode),on) +libraries = $(libs.g) +flags = $(CXXFLAGS.g) $(CXXFLAGS) +endif + +ifeq ($(debug-mode),off) +libraries = $(libs) +flags = $(CXXFLAGS.o) $(CXXFLAGS) +endif + + +############################################################ +# Typical block for building a running program +# +# 1. provide a list of source files in ...-cc-files +# +# 2. generate the list of object files according to debug-mode +# +# 3. make executable +# +# 4. Explicit dependencies of object files (will be automatic soon) +# +############################################################ + +target1-cc-files = t1.cc t2.cc t3.cc + +ifeq ($(debug-mode),on) +target1-o-files = $(target1-cc-files:.cc=.go) +else +target1-o-files = $(target1-cc-files:.cc=.o) +endif + +target1: $(target1-o-files) $(libraries) + $(CXX) $(flags) -o $@ $^ + +############################################################ +# Continue with other targets if needed +############################################################ + + + + +############################################################ +# Cleanup targets +############################################################ + +clean: + rm -f *.o *.go + +veryclean: clean + rm -f target1 *.inp *.gpl *.eps *.gnuplot + +############################################################ +# Automatic generation of dependencies +############################################################ + +all-cc-files = $(target1-cc-files) # $(target2-cc-files) ... + +Make.depend: $(all-cc-files) + @echo =====Dependecies=== Make.depend + @$(CXX) $(flags) $^ -M > $@ + @perl -pi~ -e 's/(^[^.]+)\.o:/\1.o \1.go:/;' $@ + +include Make.depend -- 2.39.5