From c3ec39c34277d30b8fec80c36c31ba72a2aca79b Mon Sep 17 00:00:00 2001 From: Guido Kanschat Date: Tue, 13 Jul 2010 04:55:47 +0000 Subject: [PATCH] make clean faster and change some dependencies in master Makefile git-svn-id: https://svn.dealii.org/trunk@21481 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/Makefile | 27 ++++++++++----------------- deal.II/base/Makefile | 18 ++++++++---------- deal.II/common/scripts/Makefile | 4 ++-- deal.II/deal.II/Makefile | 4 ++-- deal.II/doc/doxygen/Makefile.in | 2 +- deal.II/doc/doxygen/tutorial/Makefile | 2 ++ deal.II/lac/Makefile | 13 +++++++------ 7 files changed, 32 insertions(+), 38 deletions(-) diff --git a/deal.II/Makefile b/deal.II/Makefile index 5adb84dd98..1e83c7386e 100644 --- a/deal.II/Makefile +++ b/deal.II/Makefile @@ -2,7 +2,7 @@ # # Makefile for the whole library -# include global options and pathes. there's one exception where we don't want +# include global options and paths. there's one exception where we don't want # that, namely for build tests: in that case, the makefile is called before we # have even run ./configure, so we can't include this file, but the target # then called doesn't need the variables defined in there doesn't need them @@ -39,14 +39,8 @@ help: @echo "= distclean : removes all object files, libraries, etc in subdirs =" @echo "========================================================================" - -common/scripts/make_dependencies: - cd $D/common/scripts && $(MAKE) $(MAKEOPTIONS) make_dependencies - -common/scripts/expand_instantiations: - cd $D/common/scripts && $(MAKE) $(MAKEOPTIONS) expand_instantiations - -deps: common/scripts/make_dependencies common/scripts/expand_instantiations +deps: + cd $D/common/scripts && $(MAKE) $(MAKEOPTIONS) cd $D/base && $(MAKE) $(MAKEOPTIONS) Makefile.dep cd $D/lac && $(MAKE) $(MAKEOPTIONS) Makefile.dep cd $D/deal.II && $(MAKE) $(MAKEOPTIONS) Makefile.dep @@ -142,8 +136,7 @@ TAGS: perl -pi -e 's/ \* .*//g; s&[\t]*/\*.*&&g; s&[\t]*\*/.*&&g;' TAGS -clean: deps \ - clean-contrib clean-base clean-lac clean-dealII \ +clean: clean-contrib clean-base clean-lac clean-dealII \ clean-doc clean-examples clean-lib clean-tests -rm -f TODO common/TAGS @@ -151,22 +144,22 @@ clean-contrib: cd $D/contrib && $(MAKE) clean clean-base: - cd $D/base && $(MAKE) clean + cd $D/base && $(MAKE) CLEAN=yes clean clean-lac: - cd $D/lac && $(MAKE) clean + cd $D/lac && $(MAKE) CLEAN=yes clean clean-dealII: - cd $D/deal.II && $(MAKE) clean + cd $D/deal.II && $(MAKE) CLEAN=yes clean clean-doc: - cd $D/doc && $(MAKE) clean + cd $D/doc && $(MAKE) CLEAN=yes clean clean-examples: - cd $D/examples && $(MAKE) clean + cd $D/examples && $(MAKE) CLEAN=yes clean clean-lib: - cd $D/lib && $(MAKE) clean + cd $D/lib && $(MAKE) CLEAN=yes clean # if that directory exists, go into 'tests' and clean up there as well clean-tests: diff --git a/deal.II/base/Makefile b/deal.II/base/Makefile index fc7a0f8060..e59816695e 100644 --- a/deal.II/base/Makefile +++ b/deal.II/base/Makefile @@ -6,6 +6,9 @@ # deal.II top level directory D=.. +# get options which hold for all files of the project +ifneq ($(CLEAN),yes) +include $D/common/Make.global_options # create lists of file names cc-files = $(shell echo $D/base/source/*.cc) @@ -14,10 +17,6 @@ o-files = $(sort $(o-files-base)) go-files = $(o-files:.$(OBJEXT)=.g.$(OBJEXT)) h-files = $(sort $(shell echo include/base/*.h)) -# get options which hold for all files of the project -include $D/common/Make.global_options - - # there's an extra .o file for the function parser that we need to link into # libbase. do similarly for the threading building block things if threading # is enabled @@ -94,12 +93,6 @@ $(LIBDIR)/libbase.g$(shared-lib-suffix): $(go-files) @ln -f -s $(call DEAL_II_SHLIB_NAME,base.g) $@ - - -clean: - -rm -f *~ include/*~ include/*/*~ Makefile.dep source/*.inst - - # Rule to generate the dependency file. This file is # automagically remade whenever needed, i.e. whenever # one of the cc-/h-files changed. Make detects whether @@ -117,6 +110,11 @@ Makefile.dep: $(cc-files) $(h-files) Makefile $D/common/Make.global_options # include all the dependencies include Makefile.dep +endif + +clean: + -rm -f *~ include/*~ include/*/*~ Makefile.dep source/*.inst + .PHONY: clean .PHONY: lib lib$(static-lib-suffix) lib.g$(static-lib-suffix) diff --git a/deal.II/common/scripts/Makefile b/deal.II/common/scripts/Makefile index c35688d82c..bf29b23b69 100644 --- a/deal.II/common/scripts/Makefile +++ b/deal.II/common/scripts/Makefile @@ -30,9 +30,9 @@ report_features$(EXEEXT) : report_features.cc $D/common/Make.global_options @$(CXX) $(CXXFLAGS.o) $(LDFLAGS) $< -o $@ clean: - -rm -f make_dependencies + -rm -f make_dependencies$(EXEEXT) -rm -f make_dependencies.o - -rm -f expand_instantiations + -rm -f expand_instantiations$(EXEEXT) -rm -f expand_instantiations.o .PHONY: clean diff --git a/deal.II/deal.II/Makefile b/deal.II/deal.II/Makefile index 58ee0b3d19..11e920bb26 100644 --- a/deal.II/deal.II/Makefile +++ b/deal.II/deal.II/Makefile @@ -7,10 +7,9 @@ D=.. # get options which hold for all files of the project +ifneq ($(CLEAN),yes) include $D/common/Make.global_options - - # top level targets default: 2dg 2d all: 2dg 2d 3dg 3d 1dg 1d @@ -219,6 +218,7 @@ Makefile.dep: $(cc-files) $(h-files) \ # include all the dependencies include Makefile.dep +endif diff --git a/deal.II/doc/doxygen/Makefile.in b/deal.II/doc/doxygen/Makefile.in index db7eedae60..d20a2ebcc5 100644 --- a/deal.II/doc/doxygen/Makefile.in +++ b/deal.II/doc/doxygen/Makefile.in @@ -77,7 +77,7 @@ validate-xrefs: clean: -for i in deal.II/* ; do rm $$i ; done -rm *.tag - @cd tutorial ; $(MAKE) clean + @cd tutorial ; $(MAKE) CLEAN=yes clean .PHONY: html tutorial private deal.II \ diff --git a/deal.II/doc/doxygen/tutorial/Makefile b/deal.II/doc/doxygen/tutorial/Makefile index dd36756f03..a8421caf03 100644 --- a/deal.II/doc/doxygen/tutorial/Makefile +++ b/deal.II/doc/doxygen/tutorial/Makefile @@ -196,4 +196,6 @@ Makefile.dep: $(shell echo $D/examples/*/*.cc $D/examples/*/doc/*.dox) Makefile done \ > $@ +ifneq ($(CLEAN),yes) include Makefile.dep +endif diff --git a/deal.II/lac/Makefile b/deal.II/lac/Makefile index ce56af9971..e7b503ef4d 100644 --- a/deal.II/lac/Makefile +++ b/deal.II/lac/Makefile @@ -6,9 +6,9 @@ D=.. # get options which hold for all files of the project +ifneq ($(CLEAN),yes) include $D/common/Make.global_options - # create lists of file names cc-files = $(shell echo $D/lac/source/*.cc) o-files-base = $(sort $(addprefix $(LIBDIR)/lac/, $(patsubst $D/lac/source/%,%,$(cc-files:.cc=.$(OBJEXT))))) @@ -130,11 +130,6 @@ include/lac/lapack_templates.h: include/lac/lapack_templates.h.in $D/common/scri @echo ===================================== Remaking $@ @$(PERL) $D/common/scripts/lapack_templates.pl include/lac/lapack_templates.h.in > $@ - -clean: - -rm -f *~ include/*~ include/*/*~ Makefile.dep source/*.inst - - # Rule to generate the dependency file. This file is # automagically remade whenever needed, i.e. whenever # one of the cc-/h-files changed. Make detects whether @@ -153,6 +148,12 @@ Makefile.dep: include/lac/lapack_templates.h \ # include all the dependencies include Makefile.dep +endif # CLEAN + + +clean: + -rm -f *~ include/*~ include/*/*~ Makefile.dep source/*.inst + .PHONY: clean .PHONY: lib lib$(static-lib-suffix) lib.g$(static-lib-suffix) -- 2.39.5