From: wolf Date: Thu, 5 Sep 2002 14:55:50 +0000 (+0000) Subject: Remove forward declaration files. X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2101ab3bea70df447261e114da27cd64624f9a4a;p=dealii-svn.git Remove forward declaration files. git-svn-id: https://svn.dealii.org/trunk@6362 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/Makefile b/deal.II/Makefile index cd20330a0b..83daad56cf 100644 --- a/deal.II/Makefile +++ b/deal.II/Makefile @@ -18,7 +18,6 @@ help: @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 "= =" @@ -70,16 +69,11 @@ deps: 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 $@ @@ -87,13 +81,13 @@ $(LIBDIR): 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) @@ -120,11 +114,10 @@ TODO: > $@ -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 $^ diff --git a/deal.II/base/Makefile b/deal.II/base/Makefile index baa1342d46..23c0e35dcc 100644 --- a/deal.II/base/Makefile +++ b/deal.II/base/Makefile @@ -22,8 +22,6 @@ o-files = $(o-files-base3) 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 @@ -76,8 +74,6 @@ else libo: $(LIBDIR)/libbase.a endif -forward: $(forward-declarations) - $(LIBDIR)/libbase.a: $(o-files) @echo "=====base=============optimized==$(MT)== Linking library: $(@F)" @ar ru $@ $(o-files) @@ -121,9 +117,5 @@ Makefile.dep: $(cc-files) $(h-files) Makefile # 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 diff --git a/deal.II/common/scripts/forward_declarations b/deal.II/common/scripts/forward_declarations deleted file mode 100644 index 7d72fa3613..0000000000 --- a/deal.II/common/scripts/forward_declarations +++ /dev/null @@ -1,35 +0,0 @@ -# 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 diff --git a/deal.II/common/scripts/forward_declarations.pl b/deal.II/common/scripts/forward_declarations.pl deleted file mode 100644 index 7891a8872d..0000000000 --- a/deal.II/common/scripts/forward_declarations.pl +++ /dev/null @@ -1,141 +0,0 @@ -# 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 () { - # if this is continued line, then strip the backslash and join - # it with the following one as well - while ( /\\$/ ) { - $_ =~ s/\\$//; - $_ = $_ . " " . ; - } - - # 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//; - $_ = $_ . " " . ; - s/ \s+/ /g; - } - } - s/\n//; - s/ \s+/ /g; - $_ = $_ . " " . ; - } - - 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 struct Y; - # struct X {template 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"; - } - } - } - } -} diff --git a/deal.II/deal.II/Makefile b/deal.II/deal.II/Makefile index 2a8ac960d7..d2dc263118 100644 --- a/deal.II/deal.II/Makefile +++ b/deal.II/deal.II/Makefile @@ -36,10 +36,6 @@ endif 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 @@ -163,9 +159,6 @@ Makefile.dep: $(cc-files) $(h-files) Makefile # 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 - diff --git a/deal.II/lac/Makefile b/deal.II/lac/Makefile index 4726750f16..c6041e2600 100644 --- a/deal.II/lac/Makefile +++ b/deal.II/lac/Makefile @@ -17,8 +17,6 @@ o-files = $(o-files-base3) 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 @@ -49,8 +47,6 @@ else libo: $(LIBDIR)/liblac.a endif -forward: $(forward-declarations) - $(LIBDIR)/liblac.a: $(o-files) @echo "=====lac==============optimized==$(MT)== Linking library: $(@F)" @ar ru $@ $(o-files) @@ -87,9 +83,5 @@ Makefile.dep: $(cc-files) $(h-files) Makefile # 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