[cig-commits] r1360 - trunk/aspect

bangerth at dealii.org bangerth at dealii.org
Sun Nov 11 14:48:19 PST 2012


Author: bangerth
Date: 2012-11-11 15:48:18 -0700 (Sun, 11 Nov 2012)
New Revision: 1360

Modified:
   trunk/aspect/Makefile
Log:
Undo previous (and accidental) change to Makefile.

Modified: trunk/aspect/Makefile
===================================================================
--- trunk/aspect/Makefile	2012-11-11 22:47:16 UTC (rev 1359)
+++ trunk/aspect/Makefile	2012-11-11 22:48:18 UTC (rev 1360)
@@ -1,136 +1,156 @@
-# CMAKE generated file: DO NOT EDIT!
-# Generated by "Unix Makefiles" Generator, CMake Version 2.8
+# $Id: Makefile.large 22840 2010-11-22 22:28:16Z bangerth $
 
-# Default target executed when no arguments are given to make.
-default_target: all
-.PHONY : default_target
+# The large projects Makefile looks much like the one for small
+# projects. Basically, only the following seven parameters need to be
+# set by you:
 
-#=============================================================================
-# Special targets provided by cmake.
+application-name  = aspect
 
-# Disable implicit rules so canonical targets will work.
-.SUFFIXES:
+# The next variable tells us the name of the executable. It is prefixed by
+# `lib/' to designate its destination directory. Note that the program
+# name depends on the dimension, so you can keep copies for the
+# different dimensions around:
+target   = lib/$(application-name)
 
-# Remove some rules from gmake that .SUFFIXES does not remove.
-SUFFIXES =
+# The `debug-mode' variable works as in the small projects Makefile:
+debug-mode = on
 
-.SUFFIXES: .hpux_make_needs_suffix_list
+# And so does the following variable. You will have to set it to
+# something reasonable that, for example, includes the location where you
+# put output files that you want the `make clean' rule to delete
+clean-up-files =
 
-# Suppress display of executed commands.
-$(VERBOSE).SILENT:
+# Finally, here is a variable which tells the `run' rule which
+# parameters to pass to the executable. Usually, this will be the name
+# of an input file.
+run-parameters  = parameter-file.prm
 
-# A target that is always out of date.
-cmake_force:
-.PHONY : cmake_force
+# Now, this is the last variable you need to set, namely the path to
+# the deal.II toplevel directory:
+DEAL_DIR?=../../deal.II
+D = $(DEAL_DIR)
 
-#=============================================================================
-# Set environment variables for the build.
 
-# The shell in which to execute make rules.
-SHELL = /bin/sh
 
-# The CMake executable.
-CMAKE_COMMAND = /usr/bin/cmake
+#
+#
+# Usually, you will not need to change anything beyond this point.
+#
+#
+# This tells `make' where to find the global settings and rules:
+include $D/common/Make.global_options
 
-# The command to remove a file.
-RM = /usr/bin/cmake -E remove -f
 
-# The program to use to edit the cache.
-CMAKE_EDIT_COMMAND = /usr/bin/ccmake
+# list the directories and the various kinds of files
+all-dirs := source \
+	    source/simulator \
+            source/geometry_model \
+            source/gravity_model \
+            source/boundary_temperature \
+            source/initial_conditions \
+            source/compositional_initial_conditions \
+            source/material_model \
+            source/velocity_boundary_conditions \
+            source/postprocess \
+            source/postprocess/visualization
 
-# The top-level source directory on which CMake was run.
-CMAKE_SOURCE_DIR = /home/bangerth/p/deal.II/branch_cmake/projects/aspect
+cc-files := $(shell for i in $(all-dirs) ; do echo $$i/*.cc ; done)
 
-# The top-level build directory on which CMake was run.
-CMAKE_BINARY_DIR = /home/bangerth/p/deal.II/branch_cmake/projects/aspect
+tmp1     := $(shell echo $(cc-files) | $(PERL) -pi -e 's,source/,,g; s,/,_,g;')
+o-files  := $(addprefix lib/obj/, $(tmp1:.cc=.$(OBJEXT)) )
+go-files := $(addprefix lib/obj/, $(tmp1:.cc=.g.$(OBJEXT)))
 
-#=============================================================================
-# Targets provided globally by CMake.
+h-files     := $(wildcard include/aspect/*.h include/aspect/*/*h include/aspect/*/*/*h)
+lib-h-files := $(shell echo $D/include/deal.II/*/*.h)
 
-# Special rule for the target edit_cache
-edit_cache:
-	@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Running CMake cache editor..."
-	/usr/bin/ccmake -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR)
-.PHONY : edit_cache
+# As before, define two variables that denote the debug and optimized
+# versions of the deal.II libraries:
+libs.g   := $(lib-deal2.g)
+libs.o   := $(lib-deal2.o)
 
-# Special rule for the target edit_cache
-edit_cache/fast: edit_cache
-.PHONY : edit_cache/fast
+INCLUDE += -Iinclude
 
-# Special rule for the target rebuild_cache
-rebuild_cache:
-	@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Running CMake to regenerate build system..."
-	/usr/bin/cmake -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR)
-.PHONY : rebuild_cache
 
-# Special rule for the target rebuild_cache
-rebuild_cache/fast: rebuild_cache
-.PHONY : rebuild_cache/fast
+# Now use the information from above to define the set of libraries to
+# link with and the flags to be passed to the compiler:
+ifeq ($(debug-mode),on)
+  libraries = $(go-files) $(libs.g)
+  flags     = $(CXXFLAGS.g)
+else
+  libraries = $(o-files) $(libs.o)
+  flags     = $(CXXFLAGS.o)
+endif
 
-# The main all target
-all: cmake_check_build_system
-	$(CMAKE_COMMAND) -E cmake_progress_start /home/bangerth/p/deal.II/branch_cmake/projects/aspect/CMakeFiles /home/bangerth/p/deal.II/branch_cmake/projects/aspect/CMakeFiles/progress.marks
-	$(MAKE) -f CMakeFiles/Makefile2 all
-	$(CMAKE_COMMAND) -E cmake_progress_start /home/bangerth/p/deal.II/branch_cmake/projects/aspect/CMakeFiles 0
-.PHONY : all
 
-# The main clean target
-clean:
-	$(MAKE) -f CMakeFiles/Makefile2 clean
-.PHONY : clean
+# The following two rules define how to compile C++ files into object
+# files:
+lib/obj/%.g.$(OBJEXT) :
+	@echo =====$(application-name)=============debug=====$(MT)== $<
+	@$(CXX) $(flags) -c $< -o $@
+lib/obj/%.$(OBJEXT) :
+	@echo =====$(application-name)=============optimized=$(MT)== $<
+	@$(CXX) $(flags) -c $< -o $@
 
-# The main clean target
-clean/fast: clean
-.PHONY : clean/fast
 
-# Prepare targets for installation.
-preinstall: all
-	$(MAKE) -f CMakeFiles/Makefile2 preinstall
-.PHONY : preinstall
 
-# Prepare targets for installation.
-preinstall/fast:
-	$(MAKE) -f CMakeFiles/Makefile2 preinstall
-.PHONY : preinstall/fast
+# Next define how to link the executable
+build : $(target)$(EXEEXT)
+$(target)$(EXEEXT) : $(libraries) Makefile
+	@echo =====$(application-name)=======================$(MT)== Linking $@
+	@$(CXX) -o $@ $(libraries) $(LIBS) $(LDFLAGS)
 
-# clear depends
-depend:
-	$(CMAKE_COMMAND) -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 1
-.PHONY : depend
 
-#=============================================================================
-# Target rules for targets named aspect
 
-# Build rule for target.
-aspect: cmake_check_build_system
-	$(MAKE) -f CMakeFiles/Makefile2 aspect
-.PHONY : aspect
+# Rule how to run the program
+run: $(target)$(EXEEXT)
+	./$(target)$(EXEEXT) $(run-parameters)
 
-# fast build rule for target.
-aspect/fast:
-	$(MAKE) -f source/CMakeFiles/aspect.dir/build.make source/CMakeFiles/aspect.dir/build
-.PHONY : aspect/fast
+doc:
+	@cd doc ; make
 
-# Help Target
-help:
-	@echo "The following are some of the valid targets for this Makefile:"
-	@echo "... all (the default if no target is provided)"
-	@echo "... clean"
-	@echo "... depend"
-	@echo "... edit_cache"
-	@echo "... rebuild_cache"
-	@echo "... aspect"
-.PHONY : help
+indent:
+	@echo "============ Indenting all files"
+	@astyle --options=lib/astyle.rc $(h-files) $(cc-files)
 
+.PHONY: run build doc indent
 
 
-#=============================================================================
-# Special targets to cleanup operation of make.
+# Rule how to clean up. This is split into several different rules to
+# allow for parallel execution of commands:
+clean: clean-lib clean-data
+	-rm -f *~ */*~ */*/*~ source/Makefile.dep source/*/Makefile.dep
+	-cd doc ; make clean
+	-cd tests ; make clean
 
-# Special rule to run CMake to check the build system integrity.
-# No rule that depends on this can have commands that come from listfiles
-# because they might be regenerated.
-cmake_check_build_system:
-	$(CMAKE_COMMAND) -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 0
-.PHONY : cmake_check_build_system
+clean-lib:
+	-rm -f lib/obj/*.$(OBJEXT) $(target)$(EXEEXT) lib/TAGS
 
+clean-data:
+	-rm -f $(clean-up-files)
+
+
+# Again tell `make' which rules are not meant to produce files:
+.PHONY: clean clean-data clean-lib run
+
+
+# Rule to generate the dependency files, one for each source
+# directory. These file are automagically remade whenever needed,
+# i.e. whenever one of the cc-/h-files changed. Make detects whether
+# to remake this file upon inclusion below.
+#
+# If the command fails, then remove Makefile.dep again and fail
+%/Makefile.dep: $(filter $(dir $@)%, $(cc-files)) \
+                $(h-files) \
+		$(lib-h-files) \
+		Makefile
+	@echo "====================================== Remaking $@"
+	@(($D/common/scripts/make_dependencies -n $(INCLUDE) "-Blib/obj" \
+			$(filter $(dir $@)%, $(cc-files)) \
+		| $(PERL) -pe 's!debug/(.*)\.o:!$(subst source_,,$(subst /,_,$(dir $@)))\1.g.o:!g;' \
+		| $(PERL) -pe 's!optimized/(.*)\.o:!$(subst source_,,$(subst /,_,$(dir $@)))\1.o:!g;' \
+	  ) > $@) \
+	 || (rm -f $@ ; false)
+
+
+# include all the dependencies
+include $(addsuffix /Makefile.dep, $(all-dirs))



More information about the CIG-COMMITS mailing list