From 7f84ccd2e4263ecd3ef9f835cfbaccc1edcc87b9 Mon Sep 17 00:00:00 2001 From: wolf Date: Thu, 12 Aug 1999 08:27:50 +0000 Subject: [PATCH] Add missing file. git-svn-id: https://svn.dealii.org/trunk@1682 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/common/Make.global_options | 2 +- deal.II/common/scripts/forward_declarations | 43 +++++++++++++++++++++ 2 files changed, 44 insertions(+), 1 deletion(-) create mode 100644 deal.II/common/scripts/forward_declarations diff --git a/deal.II/common/Make.global_options b/deal.II/common/Make.global_options index 88d519046a..30088387c7 100644 --- a/deal.II/common/Make.global_options +++ b/deal.II/common/Make.global_options @@ -19,7 +19,7 @@ CXXFLAGS.g= -ansi -DDEBUG -ggdb -Wall -W -Wconversion \ $(INCLUDE) CXXFLAGS.o= -O2 -Wuninitialized -ffast-math \ -felide-constructors -fnonnull-objects \ - -fno-vtable-thunks -ftemplate-depth-32\ + -fno-vtable-thunks -ftemplate-depth-32 -pg\ $(INCLUDE) diff --git a/deal.II/common/scripts/forward_declarations b/deal.II/common/scripts/forward_declarations new file mode 100644 index 0000000000..daea0cfa65 --- /dev/null +++ b/deal.II/common/scripts/forward_declarations @@ -0,0 +1,43 @@ +# rule how to make the file containing all the forward declarations +# taken from the deal.II Makefile +# +# this rule is rather complicated, it works as follows: +# +# - if this is the outermost 'make', then 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 +# - we would like to compare the output of the script generating +# the forward declarations with the old file, or the empty +# string if there is no such file; this is why we created $@.old +# - if the files differ, we would like to copy over the old file. +# - this can either be done using shell programming using 'if [...]' +# or using conditionals inside 'make'. the first way is not +# portable over different shells, however, and I also do not know +# how to write it. the second way has a problem also: conditionals +# are evaluated at the time the Makefile is read first, so we +# can't compare against $@.old, since this file does not exist at +# that time. +# - we therefore invoke a second 'make', which can compare the two +# files against each other in a preconditional clause and +# copy over the file if necessary. +# - delete the two temporary files +$(forward-declarations): $(filter-out %forward-declarations%,$(h-files)) +ifneq (1,${recursive-make-fwd-decl}) + @echo ============================ Checking $@ + @touch $@.old + -@cp $@ $@.old > /dev/null 2>&1 + @perl $D/common/scripts/Make_forward_declarations.pl $(filter-out %forward-declarations.h,$(h-files)) > $@.new + @make --silent recursive-make-fwd-decl=1 $@ + @rm $@.old $@.new +else + ifneq (,$(shell diff $(forward-declarations).old $(forward-declarations).new)) + @echo ============================ Generating $@ + @cp $@.new $@ + else + @echo "============================ $@ needs no change" + endif +endif -- 2.39.5