From: Wolfgang Bangerth " >> $@
+ @echo "
" >> $@
+ @echo "Makefile variable Value in common/Make.global_options
" >> $@
@echo $(VARIABLE_VALUES) >> $@
@echo "
- Following is a partial list of available flags which are exported to
- other Makefiles. There are additional flags, in particular ones that
+ Following is a partial list of available variables which are exported to
+ other Makefiles. There are additional variables, in particular ones that
determine the interaction with other libraries such as PETSc, Trilinos,
METIS, etc; for details on these variables, take a look
at common/Make.global_options
.
@@ -377,7 +377,7 @@
-
- In this section, we provide templates for Makefiles for - applications based on the deal.II - libraries. They show how to use the information provided by the - variables explained above. + deal.II comes with sample Makefiles for + applications that use this library. They show how to use the information + provided by the variables explained above.
- At present, we have three Makefiles, one for small projects - consisting of only one C++ file, and one for large projects. - Furthermore, there is a Makefile in a different style. Have - a look at them and see what seem convenient to you. All Makefiles + At present, there are two such Makefile templates. All Makefiles need slight modifications before they will work in your - project. The places for modifications are marked. + project; the places for modifications are marked and easy to find. The + templates are:
Small
- projects: This Makefile is targeted at applications which
- are written to simply try something, or prove an
- assumption. Such applications are the
+ project Makefile: This Makefile is targeted at small
+ applications consisting of only a single .cc
+ file. Examples of this kind are the
step-by-step
- examples. These small problems are probably not the
- usual case in real life, but you may want to take a look at
- this file in order to get an idea on how it works, or you
- go directly to the large projects file.
-
+ tutorial programs. You can find this Makefile here.
@@ -48,54 +36,42 @@ directory in which the whole project is located):project/source
- project/include
- project/lib
+ project/source
: The location of all
+ your .h
files.
+ project/include
: The location of all
+ your .cc
files.
+ project/lib
: Where the Makefile will
+ put the final executable.
project/lib/1d
- project/lib/2d
- project/lib/3d
+ project/lib/1d
: Where the Makefile will
+ put your object files if you compile for 1d.
+ project/lib/2d
: Same for 2d.
+ project/lib/3d
: Same for 3d.
- Include files need to be placed into
- project/include
, while implementation files
- are to be in project/source
. The executable
- will be in project/lib
and the compiled object
- files will be in project/lib/?d
, depending on
- the dimension for which the project is compiled. Using this
- directory structure, it is possible to quickly switch
- between dimensions in which a program shall run in,
- enabling us to develop applications which run in 1d, 2d, or
- 3d without long compilation times. Furthermore, placing
- object files in different directories prevents cluttering
- directories with unnecessarily many files.
+ Using this
+ directory structure, it is possible to quickly switch
+ between dimensions in which a program shall run in,
+ enabling us to develop applications which run in 1d, 2d, or
+ 3d without long compilation times. Furthermore, placing
+ object files in different directories prevents cluttering
+ directories with unnecessarily many files.
- The dimension for which the project shall be compiled is
- not stated in the source code, as in the small projects
- Makefile, but is determined by a flag which is given in the
- Makefile. To determine the dimension for which a project is
- compiled in your source file, use the preprocessor constant
- `deal_II_dimension' which is set by the Makefile and passed
- through the compiler.
+ The dimension for which the project shall be compiled is
+ not stated in the source code, as in the small projects
+ Makefile, but is determined by a flag set in the
+ Makefile. The Makefile then makes sure that the preprocessor
+ constant deal_II_dimension
is set appropriately and
+ passed through to the compiler when creating object files.
You can find this Makefile here.
-
-
- The third
- Makefile is common/Makefile.template
in
- the deal.II directory tree.
-
- It was designed for several targets in one directory and
- makes use of the compilation rules in
- common/Make.rules
. All object files and
- executables will be in the same directory.