-# GNUmakefile has priority over Makefile for GNU Make.
-# So if a Makefile was generated by CMake due to an in-source configure
-# chain-load it:
-ifneq ($(wildcard Makefile),)
- include Makefile
-else
- .PHONY: all
- all:
- @echo ""
- @echo "###"
- @echo "#"
- @echo "# Support GNUmakefile for deal.II"
- @echo "#"
- @echo "# TODO: Helpful message on how to use CMake"
- @echo "#"
- @echo "# The following support targets exist:"
- @echo "# indent - run astyle on the source base"
- @echo "# cmake - bootstrap CMake in ./bundled/cmake"
- @echo "# build_test - run a build test. The following _optional_ environment"
- @echo "# variables are considered:"
- @echo "# LOGDIR - path for log output"
- @echo "# CONFIGFILE - optional path to a configuration file"
- @echo "#"
- @echo "# CMAKE - the cmake executable, defaults to 'cmake'"
- @echo "# MAKEOPTS - options for gmake"
- @echo "# TMPDIR"
- @echo "#"
- @echo "###"
- @echo ""
-endif
-
-
style-h-files:= $(wildcard include/deal.II/*/*.h)
style-cc-files:= $(wildcard source/*/*.cc)
style-examples:= $(wildcard examples/*/*.cc)
done
-.PHONY: cmake
-cmake:
- cd bundled/cmake && make
- @echo ""
- @echo "###"
- @echo "#"
- @echo "# CMake successfully bootstrapped in bundled/cmake"
- @echo "#"
- @echo "# Please add"
- @echo "# export PATH=\"$(PWD)/bundled/cmake/bin:\$$PATH\""
- @echo "# to your ~/.bashrc file (or similar)."
- @echo "#"
- @echo "###"
- @echo ""
-
-
#
# Target for build tests:
#
--- /dev/null
+style-h-files:= $(wildcard include/deal.II/*/*.h)
+style-cc-files:= $(wildcard source/*/*.cc)
+style-examples:= $(wildcard examples/*/*.cc)
+.PHONY: indent
+indent:
+ @echo "Indenting all files"
+ @for f in $(style-h-files) $(style-cc-files) $(style-examples) ;\
+ do\
+ echo $$f ;\
+ astyle --options=contrib/utilities/astyle.rc $$f ;\
+ done
+
+
+#
+# Target for build tests:
+#
+TMPDIR=/tmp
+CMAKE=cmake
+SVN=svn info .
+date:= $(shell date +%s)
+random:=$(shell echo "$$RANDOM")
+testdir:= "$(TMPDIR)"/deal-build-test.$(date)-$(random)
+builddir:= $(testdir)/build
+installdir:= $(testdir)/install
+LOGDIR=$(PWD)
+logfile:=$(LOGDIR)/$(date).$(firstword $(notdir $(CONFIGFILE)) automatic).log
+CLEANUP=true
+TEEnTRAP:= | tee -a $(logfile) || (if ${CLEANUP}; then rm -rf $(testdir); fi; false)
+PIPEnTRAP:= >>$(logfile) 2>&1 || (if ${CLEANUP}; then rm -rf $(testdir); fi; false)
+
+.PHONY: build_test
+build_test:
+ mkdir -p $(LOGDIR)
+ mkdir -p $(builddir)
+ mkdir -p $(installdir)
+ @echo "AUTOMATED DEAL.II BUILD TEST" | tee $(logfile)
+ @echo "BEGIN HEADER `date -u '+%Y-%m-%d %T'`" | tee -a $(logfile)
+ @$(SVN) | perl -ne 'print "dealii-feature: revision=$$_" if s/Last Changed Rev: //; print "dealii-feature: branch=$$1\n" if m/svn\.dealii\.org\/(.+)\/deal.II/;' $(TEEnTRAP)
+ @echo "dealii-feature: user=$(USER)" | tee -a $(logfile)
+ @echo "dealii-feature: host=`hostname`" | tee -a $(logfile)
+ @echo "dealii-feature: configuration=`basename \"$(CONFIGFILE)\"`" | tee -a $(logfile)
+ @echo END HEADER `date -u '+%Y-%m-%d %T'`\n | tee -a $(logfile)
+ @echo "BEGIN CONFIGURE OUTPUT `date -u '+%Y-%m-%d %T'`" | tee -a $(logfile)
+ cd $(builddir) && "$(CMAKE)" -C "$(CONFIGFILE)" -DCMAKE_INSTALL_PREFIX=$(installdir) $(PWD) $(PIPEnTRAP)
+ @echo "END CONFIGURE OUTPUT `date -u '+%Y-%m-%d %T'`" | tee -a $(logfile)
+ @echo "BEGIN CMAKE SYSTEM INFORMATION `date -u '+%Y-%m-%d %T'`" | tee -a $(logfile)
+ cd $(builddir) && "$(CMAKE)" --system-information $(PIPEnTRAP)
+ @echo "END CMAKE SYSTEM INFORMATION `date -u '+%Y-%m-%d %T'`" | tee -a $(logfile)
+ @echo "BEGIN REPORT FEATURES `date -u '+%Y-%m-%d %T'`" | tee -a $(logfile)
+ cd $(builddir) && make $(MAKEOPTS) run_report_features $(PIPEnTRAP)
+ @echo "END REPORT FEATURES `date -u '+%Y-%m-%d %T'`" | tee -a $(logfile)
+ @echo "BEGIN BUILD INSTALL OUTPUT `date -u '+%Y-%m-%d %T'`" | tee -a $(logfile)
+ cd $(builddir) && make $(MAKEOPTS) install $(PIPEnTRAP)
+ @echo "END BUILD INSTALL OUTPUT `date -u '+%Y-%m-%d %T'`" | tee -a $(logfile)
+ @echo "BEGIN BUILD EXAMPLES OUTPUT `date -u '+%Y-%m-%d %T'`" | tee -a $(logfile)
+ cd $(installdir)/examples && make $(MAKEOPTS) build_examples $(PIPEnTRAP)
+ @echo "END BUILD EXAMPLES OUTPUT `date -u '+%Y-%m-%d %T'`" | tee -a $(logfile)
+ @echo "BEGIN RUN EXAMPLES OUTPUT `date -u '+%Y-%m-%d %T'`" | tee -a $(logfile)
+ cd $(installdir)/examples && make $(MAKEOPTS) run_examples $(PIPEnTRAP)
+ @echo "END RUN EXAMPLES OUTPUT `date -u '+%Y-%m-%d %T'`" | tee -a $(logfile)
+ rm -rf $(testdir)
+++ /dev/null
-#####
-##
-## Copyright (C) 2012, 2013 by the deal.II authors
-##
-## This file is part of the deal.II library.
-##
-## <TODO: Full License information>
-## This file is dual licensed under QPL 1.0 and LGPL 2.1 or any later
-## version of the LGPL license.
-##
-## Author: Matthias Maier <matthias.maier@iwr.uni-heidelberg.de>
-##
-#####
-
-#
-# Compile the deal.II library
-#
-
-INCLUDE_DIRECTORIES(
- ${CMAKE_BINARY_DIR}/include/
- ${CMAKE_SOURCE_DIR}/include/
- )
-
-#
-# List the directories where we have source files. the ones with the longest
-# compile jobs come first so that 'make -j N' saturates many processors also
-# towards the end of compiling rather than having to wait for one long
-# compilation that, because it has been listed last, is started towards the
-# end of everything (e.g. numerics/vectors.cc takes several minutes to
-# compile...)
-#
-ADD_SUBDIRECTORY(numerics)
-ADD_SUBDIRECTORY(fe)
-ADD_SUBDIRECTORY(dofs)
-ADD_SUBDIRECTORY(lac)
-ADD_SUBDIRECTORY(base)
-ADD_SUBDIRECTORY(grid)
-ADD_SUBDIRECTORY(hp)
-ADD_SUBDIRECTORY(multigrid)
-ADD_SUBDIRECTORY(distributed)
-
-
-FOREACH(build ${DEAL_II_BUILD_TYPES})
- STRING(TOLOWER ${build} build_lowercase)
-
- #
- # Combine all ${build} OBJECT targets to a ${build} library:
- #
- FILE(STRINGS
- ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/deal_ii_objects_${build_lowercase}
- deal_ii_objects_${build_lowercase}
- )
- ADD_LIBRARY(${DEAL_II_BASE_NAME}${DEAL_II_${build}_SUFFIX}
- ${deal_ii_objects_${build_lowercase}}
- )
-
- SET_TARGET_PROPERTIES(${DEAL_II_BASE_NAME}${DEAL_II_${build}_SUFFIX}
- PROPERTIES
- VERSION ${VERSION}
- #
- # Sonaming: Well... we just use the version number.
- # No point to wrack one's brain over the question whether a new version of
- # a C++ library is still ABI backwards compatible :-]
- #
- SOVERSION ${VERSION}
- LINK_FLAGS "${DEAL_II_SHARED_LINKER_FLAGS_${build}}"
- COMPILE_DEFINITIONS "${DEAL_II_DEFINITIONS};${DEAL_II_DEFINITIONS_${build}}"
- COMPILE_FLAGS "${DEAL_II_CXX_FLAGS_${build}}"
- )
-
- TARGET_LINK_LIBRARIES(${DEAL_II_BASE_NAME}${DEAL_II_${build}_SUFFIX}
- ${DEAL_II_EXTERNAL_LIBRARIES}
- ${DEAL_II_EXTERNAL_LIBRARIES_${build}}
- )
-
- INSTALL(TARGETS ${DEAL_II_BASE_NAME}${DEAL_II_${build}_SUFFIX}
- EXPORT ${DEAL_II_PROJECT_CONFIG_NAME}Targets
- DESTINATION ${DEAL_II_LIBRARY_RELDIR}
- COMPONENT library
- )
-
- #
- # Information for legacy Make.global_options
- #
- GET_TARGET_PROPERTY(lib ${DEAL_II_BASE_NAME}${DEAL_II_${build}_SUFFIX} LOCATION)
- GET_FILENAME_COMPONENT(lib "${lib}" NAME)
- SET(MAKEFILE_LIBRARY_${build} "${CMAKE_INSTALL_PREFIX}/${DEAL_II_LIBRARY_RELDIR}/${lib}" PARENT_SCOPE)
-
-ENDFOREACH()
-
-INSTALL(EXPORT ${DEAL_II_PROJECT_CONFIG_NAME}Targets
- DESTINATION ${DEAL_II_PROJECT_CONFIG_RELDIR}
- COMPONENT library
- )