cd multigrid ; $(MAKE)
report: compare abort.o
- @for i in base lac fe deal.II multigrid bits ; do \
+ @for i in base lac fe deal.II multigrid bits all-headers ; do \
echo =======Report: $$i ======= ; \
cd $$i ; $(MAKE) report ; cd .. ; \
done
- @echo =======Report: all-headers =======
- @if (($(MAKE) all-headers 2>&1) > /dev/null) ; then \
- echo `date -u +"%Y-%m-%d %H:%M"` + all/headers/all-headers ; \
- else \
- echo `date -u +"%Y-%m-%d %H:%M"` - all-headers/all-headers ; \
- fi
report+mail:
@$(MAKE) report | tee testresults
cd multigrid ; $(MAKE) output
-# collect all header files, and for each try to do the following:
-# generate a file tmp.cc that contains nothing but "#include <xxx>"
-# with this particular header file. then try to compile it. this
-# sometimes fails since this header does not include all other headers
-# it actually needs. we don't usually see this since we may be
-# including these missing headers into our files before, so that nobody
-# notices the problem. expose it this way.
-#
-# this all happens in a subdir tmp-all-headers, which is removed
-# afterwards again.
-all-headers:
- @rm -rf tmp-all-headers
- @mkdir tmp-all-headers
- @for i in base lac deal.II ; do \
- pushd . > /dev/null ; \
- headers=`cd $D/$$i/include ; \
- for j in */*.h ; do echo $$j ; done` ; \
- popd > /dev/null ; \
- cd tmp-all-headers ; \
- cp ../Makefile.headers Makefile ; \
- for j in $$headers ; do \
- echo "=====Header======== $$j " ; \
- echo "#include <$$j>" > tmp.cc ; \
- if $(MAKE) -s tmp.g.$(OBJEXT) ; then : ; else exit 1 ; fi ; \
- rm -f tmp.* ; \
- done ; \
- cd .. ; \
- done
- @rm -rf tmp-all-headers
# generate a link to system specific test program output. we create
+++ /dev/null
-# Generated automatically from Makefile.in by configure.
-# Generated automatically from Makefile.in by configure.
-############################################################
-# Makefile,v 1.27 2002/09/03 17:39:25 wolf Exp
-# Copyright (C) 2000, 2001, 2002, 2003 by the deal.II authors
-############################################################
-
-############################################################
-# Include general settings for including DEAL libraries
-############################################################
-
-include ../Makefile.paths
-include $D/common/Make.global_options
-debug-mode = on
-
-default: tmp.g.$(OBJEXT)
-
-include ../Makefile.rules
--- /dev/null
+# collect all header files, and for each try to do the following:
+# generate a file tmp.cc that contains nothing but "#include <xxx>"
+# with this particular header file. then try to compile it. this
+# sometimes fails since this header does not include all other headers
+# it actually needs. we don't usually see this since we may be
+# including these missing headers into our files before, so that nobody
+# notices the problem. expose it this way.
+
+include ../Makefile.paths
+include $D/common/Make.global_options
+
+############################################################
+# First how to create executables, including all necessary
+# flags:
+############################################################
+
+flags = $(CXXFLAGS.g)
+
+ifeq ($(findstring gcc,$(GXX_VERSION)),gcc)
+flags += -Wno-missing-noreturn
+endif
+
+%.g.$(OBJEXT) : %.cc Makefile
+ @echo =====debug========= $<
+ @$(CXX) $(flags) -c $< -o $@
+
+%.$(OBJEXT) : %.cc Makefile
+ @echo =====optimized===== $<
+ @$(CXX) $(CXXFLAGS.o) -c $< -o $@
+
+
+default:all
+
+# collect all headers
+HEADERS = $(shell cd $D; echo */include/*/*.h)
+TESTS = $(HEADERS:%=test-%)
+
+
+# we need two auxiliary functions. the first one takes a filename and replaces
+# all occurrences of slashes by hyphens, so that we can create a .cc file that
+# corresponds to a header file in a different directory
+subst_slashes = $(shell echo $(1) | $(PERL) -pi -e 's/\//-/g;')
+
+# the second one takes a path to a header file and makes sure that we can
+# #include it, i.e. it drops the top-level xxx/include/ part of the filename,
+# since we only find include directives like <grid/tria.h>
+normalize = $(shell echo $(1) | $(PERL) -pi -e 's/.*include.//g;')
+
+
+# next the target that creates the target rules. First, we list all the header
+# files as the head of the rule, followed by a colon. Then the actual rule
+# that includes writing the .cc file that only includes a single header file,
+# compiles it, and then deletes everything again
+Makefile.dep: $(HEADERS:%=$D/%) Makefile
+ @for i in $(HEADERS) ; do \
+ echo test-$$i \\ ; \
+ done > Makefile.dep
+ @echo : >> Makefile.dep
+ @echo ' @echo "#include <$$(call normalize,$$@)>" > $$(call subst_slashes,$$@).cc' >> Makefile.dep
+ @echo ' @$$(MAKE) $$(call subst_slashes,$$@).g.o' >> Makefile.dep
+ @echo ' @rm -f $$(call subst_slashes,$$@).g.o' >> Makefile.dep
+ @echo ' @rm -f $$(call subst_slashes,$$@).cc' >> Makefile.dep
+
+include Makefile.dep
+
+
+# here's what's to be done
+all: $(TESTS)
+
+
+# create a report, where we get exactly one line per test
+report:
+ @for test in $(TESTS) ; do \
+ testname=all-headers/`echo $$test | perl -pi -e 's/.*include.//g; s/\//-/g;'` ; \
+ if (($(MAKE) $$test 2>&1) > /dev/null); then \
+ echo `date -u +"%Y-%m-%d %H:%M"` + $$testname ; \
+ else \
+ echo `date -u +"%Y-%m-%d %H:%M"` - $$testname ; \
+ fi ; \
+ done
+
+
+clean:
+ -rm -f Makefile.dep *.$(OBJEXT) \
+ *.g.$(OBJEXT) *.output *~
+
+
+.PHONY: report clean distclean