@echo "= 1dg 2dg 3dg: deal.II debug version for specified dimension ="
@echo "= 1do 2do 3do: deal.II optimized version for specified dimension ="
@echo "= 1d 2d 3d : deal.II debug and optimized for specified dimension ="
- @echo "= forward : forward_declarations.h for all libraries ="
@echo "= ="
@echo "= contrib : additional libraries in contrib, if there are any ="
@echo "= ="
cd $D/lac ; $(MAKE) $(MAKEOPTIONS) Makefile.dep
cd $D/deal.II ; $(MAKE) $(MAKEOPTIONS) Makefile.dep
-base: baseg baseo forward
-lac: lacg laco forward
-1d: 1dg 1do forward
-2d: 2dg 2do forward
-3d: 3dg 3do forward
-
-forward:
- cd $D/base ; $(MAKE) $(MAKEOPTIONS) forward
- cd $D/lac ; $(MAKE) $(MAKEOPTIONS) forward
- cd $D/deal.II ; $(MAKE) $(MAKEOPTIONS) forward
+base: baseg baseo
+lac: lacg laco
+1d: 1dg 1do
+2d: 2dg 2do
+3d: 3dg 3do
$(LIBDIR):
mkdir $@
baseg base lacg lac 1dg 1d 2dg 2d 3dg 3d all debug contrib : $(LIBDIR)
all: deps
- $(MAKE) $(MAKEOPTIONS) contrib base lac 2d 1d 3d forward
+ $(MAKE) $(MAKEOPTIONS) contrib base lac 2d 1d 3d
debug: deps
- $(MAKE) $(MAKEOPTIONS) contrib baseg lacg 2dg 1dg 3dg forward
+ $(MAKE) $(MAKEOPTIONS) contrib baseg lacg 2dg 1dg 3dg
optimized: deps
- $(MAKE) $(MAKEOPTIONS) contrib baseo laco 2do 1do 3do forward
+ $(MAKE) $(MAKEOPTIONS) contrib baseo laco 2do 1do 3do
contrib:
cd $D/contrib ; $(MAKE)
> $@
-TAGS: $(filter-out %/forward_declarations.h, \
- $(shell echo $D/base/source/*.cc $D/base/include/*/*.h \
- $D/lac/source/*.cc $D/lac/include/*/*.h \
- $D/deal.II/source/*/*.cc $D/deal.II/include/*/*.h \
- $D/tests/*/*.cc $D/tests/*/*.h ))
+TAGS: $(shell echo $D/base/source/*.cc $D/base/include/*/*.h \
+ $D/lac/source/*.cc $D/lac/include/*/*.h \
+ $D/deal.II/source/*/*.cc $D/deal.II/include/*/*.h \
+ $D/tests/*/*.cc $D/tests/*/*.h )
@cd $D/common ; etags $^
go-files = $(o-files-base3:.o=.g.o)
h-files = $(sort $(shell echo include/base/*.h))
-forward-declarations = $D/base/include/base/forward_declarations.h
-
# get options which hold for all files of the project
include $D/common/Make.global_options
libo: $(LIBDIR)/libbase.a
endif
-forward: $(forward-declarations)
-
$(LIBDIR)/libbase.a: $(o-files)
@echo "=====base=============optimized==$(MT)== Linking library: $(@F)"
@ar ru $@ $(o-files)
# include all the dependencies
include Makefile.dep
-# include a rule which tells how to remake the forward declarations file
-include $D/common/scripts/forward_declarations
-
-
.PHONY: clean
.PHONY: lib lib.a lib.g.a
+++ /dev/null
-# rule how to make the file containing all the forward declarations
-# taken from the deal.II Makefile
-#
-# to explain what this rule does:
-#
-# - create a file $@.old.
-# if the forward declaration file $@ already exists, then copy
-# it over, otherwise leave it empty. this way, we always have
-# a file to run diff on. send the output of the copy command
-# (which may fail) to nirvana.
-# - write the forward declarations for the presently available
-# header files to $@.new. Use all header files except the
-# forward declarations file itself
-# - compare old and new forward-declarations files. if they
-# differ (i.e. the result of 'diff' is a nonzero string) copy
-# the new file over the old one and thus also change the time
-# stamp of that file. if they don't differ, then do nothing
-# and in particular don't touch the time stamp to avoid that
-# 'make' thinks it has to remake all object files
-# - delete the two temporary files
-$(forward-declarations): $(filter-out %forward-declarations%,$(h-files)) \
- $D/common/scripts/forward_declarations.pl
- @echo ============================ Remaking $(@F)
- @-touch $@.old
- @if test -r $@ ; then cp $@ $@.old > /dev/null 2>&1 ; fi
- @$(PERL) $D/common/scripts/forward_declarations.pl \
- $(filter-out %$(notdir $(forward-declarations)),$(h-files)) \
- > $@.new
- @if test -n "`diff $(forward-declarations).old $(forward-declarations).new`" ; then \
- echo "============================ file remade" ; \
- cp $@.new $@ ; \
- else \
- echo "============================ file unchanged" ; \
- fi
- @rm $@.old $@.new
+++ /dev/null
-# call this script with a list of files it shall process for
-# class and struct declarations.
-
-
-#fill list of files to be processed
-while ($ARGV[0]) {
- @input_files = (@input_files, shift);
-}
-
-
-# generate a guard for the file to disallow multiple inclusion
-$guard = `pwd`;
-# in case the string gets longer than the number of significant
-# positions for the preprocessor is, it is safer to use the
-# last parts of the string fist. therefore, split the string
-# at the slashes and assemble it again backwards
-$guard = join("/", reverse(split(/\//, $guard)));
-$guard =~ s![^\w]!_!g;
-$guard .= "__guard";
-print "#ifndef $guard\n";
-print "#define $guard\n";
-print "\n";
-
-print "/* this file is automatically generated from the Makefile; do not\n";
-print " * change it by hand. */\n";
-print "\n\n";
-
-foreach $file (@input_files) {
- parse_class_declarations ($file);
-};
-
-print "\n\n";
-print "#endif // $guard\n";
-
-
-
-
-sub parse_class_declarations {
- local ($filename) = $_[0];
-
- open (FILE, $filename);
- while (<FILE>) {
- # if this is continued line, then strip the backslash and join
- # it with the following one as well
- while ( /\\$/ ) {
- $_ =~ s/\\$//;
- $_ = $_ . " " . <FILE>;
- }
-
- # if the lines contains a "template" at the
- # beginning and no semicolon at the end: join it
- # with the next line.
- if ( /^\s*template/ && !/;\s*$/ ) {
- # if this is a multiline template, then join following lines as well
- # find out by looking at the last char of the line
- while ( ! />\s*$/ ) {
- # more concise check: find out whether the number of '<' is
- # not equal to the number of '>'
- my ( $tmp1, $tmp2 ) = ($_, $_);
- $tmp1 =~ s/[^<]//g;
- $tmp2 =~ s/[^>]//g;
- if ( length ($tmp1) == length ($tmp2) ) {
- last;
- }
- else
- {
- s/\n//;
- $_ = $_ . " " . <FILE>;
- s/ \s+/ /g;
- }
- }
- s/\n//;
- s/ \s+/ /g;
- $_ = $_ . " " . <FILE>;
- }
-
- if ( /^\s*((template\s*<
- (
- ([-\w,_=:\s] |
- <([-\w_,=:\s])+> )*
- )>\s*)?
- (class|struct))(.*)/x ) {
- # this is the declaration of a class, possibly a template
- $basepart = $1;
- $rest = $7;
-
- # test whether it is a forward declaration or something else.
- # if it is a forward declaration, then skip it, as it must
- # be declared somewhere else properly
- # (note that $rest contains the name of the class and what
- # comes after that)
- if ( $rest =~ /;\s*$/ ) {
- next;
- }
-
- # first extract the name of the class
- $rest =~ /([\w_]+(\s*<(([-\w,_\s]|<([-\w,\s])+>)+)>)?)(.*)/;
-
- $name = $1;
- $rest = $6;
-
- # we look for declarations, where after the name comes a colon
- # or an open-brace, maybe also a semicolon or just nothing
- #
- # the colon might be of an inheritance list, but we do not
- # want it to come from a nested class declaration
- if (($rest =~ /^\s*([\{;]|:[^:])/) || ($rest =~ /^\s*$/)) {
- $declaration = $basepart . " " . $name;
- # strip double spaces etc.
- $declaration =~ s/\s\s+/ /g;
- $declaration =~ s/^\s+//g;
- $declaration =~ s/\s+$//g;
-
- # strip default template parameters
- while ( $declaration =~ s/<(.*)=\s*[-\w,_:\s]+(<[^.]*>)?(.*)>/<$1 $3 > / ) {
- }
-
- # impose a negativ-list of names we do not want to
- # have in this file. this is due to a compiler bug in
- # egcs 1.1.2, which does not gracefully handle local
- # template classes if their name is globally defined,
- # for example
- #
- # template <int dim> struct Y;
- # struct X {template <int dim> struct Y{}; };
- # X::Y<1> y;
- #
- # does not work. So we filter out these classes at
- # present. A better way would certainly be to only
- # allow those classes into the forward-declarations.h
- # file that are global, but that would mean parsing
- # the include files instead of just searching for
- # small bits...
- if ( ! ($declaration =~ /EpsFlags|Patch|Mem_Fun_Data|Fun_Data/ ))
- {
- print $declaration, ";\n";
- }
- }
- }
- }
-}
cc-files = $(shell echo source/*/*.cc)
h-files = $(sort $(shell echo include/*/*.h))
-forward-declarations = $D/deal.II/include/grid/forward_declarations.h
-
-forward: $(forward-declarations)
-
# strip subdirectories from cc file names, preprend a "lib/[g]o"
# and change the suffix. We place the object files with or without
# include all the dependencies
include Makefile.dep
-# include a rule which tells how to remake the forward declarations file
-include $D/common/scripts/forward_declarations
-
go-files = $(o-files-base3:.o=.g.o)
h-files = $(sort $(shell echo include/lac/*.h))
-forward-declarations = $D/lac/include/lac/forward_declarations.h
-
# get options which hold for all files of the project
include $D/common/Make.global_options
libo: $(LIBDIR)/liblac.a
endif
-forward: $(forward-declarations)
-
$(LIBDIR)/liblac.a: $(o-files)
@echo "=====lac==============optimized==$(MT)== Linking library: $(@F)"
@ar ru $@ $(o-files)
# include all the dependencies
include Makefile.dep
-# include a rule which tells how to remake the forward declarations file
-include $D/common/scripts/forward_declarations
-
-
.PHONY: clean
.PHONY: lib lib.a lib.g.a