From 11d73d12c1fd8e4d8a79c7d9a9c82034d6e6b81f Mon Sep 17 00:00:00 2001 From: Harry Moffat Date: Thu, 29 Jul 2004 22:14:33 +0000 Subject: [PATCH] Added depends target to makefiles --- test_problems/Makefile.in | 10 +++++ test_problems/ck2cti_test/Makefile.in | 2 + test_problems/cxx_ex/Makefile.in | 2 + test_problems/cxx_ex/gri30.xml | 42 +-------------------- test_problems/diamondSurf/Makefile.in | 24 ++---------- test_problems/silane_equil/.cvsignore | 2 + test_problems/silane_equil/Makefile.in | 32 ++++++++++++---- test_problems/silane_equil/silane_equil.cpp | 1 + test_problems/surfkin/Makefile.in | 11 +++--- 9 files changed, 52 insertions(+), 74 deletions(-) diff --git a/test_problems/Makefile.in b/test_problems/Makefile.in index d81f987ad..c4fc40b14 100644 --- a/test_problems/Makefile.in +++ b/test_problems/Makefile.in @@ -9,12 +9,14 @@ all: cd silane_equil; @MAKE@ all cd surfkin; @MAKE@ all cd diamondSurf; @MAKE@ all + cd ck2cti_test; @MAKE@ all test: cd cxx_ex; @MAKE@ test cd silane_equil; @MAKE@ test cd surfkin; @MAKE@ test cd diamondSurf; @MAKE@ test + cd ck2cti_test; @MAKE@ test clean: $(RM) *.*~ @@ -22,4 +24,12 @@ clean: cd silane_equil; @MAKE@ clean cd surfkin; @MAKE@ clean cd diamondSurf; @MAKE@ clean + cd ck2cti_test; @MAKE@ clean + +depends: + cd cxx_ex; @MAKE@ depends + cd silane_equil; @MAKE@ depends + cd surfkin; @MAKE@ depends + cd diamondSurf; @MAKE@ depends + cd ck2cti_test; @MAKE@ depends diff --git a/test_problems/ck2cti_test/Makefile.in b/test_problems/ck2cti_test/Makefile.in index 182c9adf7..ef75eba35 100644 --- a/test_problems/ck2cti_test/Makefile.in +++ b/test_problems/ck2cti_test/Makefile.in @@ -12,3 +12,5 @@ test: clean: ../../bin/rm_cvsignore +depends: + diff --git a/test_problems/cxx_ex/Makefile.in b/test_problems/cxx_ex/Makefile.in index 182c9adf7..ef75eba35 100644 --- a/test_problems/cxx_ex/Makefile.in +++ b/test_problems/cxx_ex/Makefile.in @@ -12,3 +12,5 @@ test: clean: ../../bin/rm_cvsignore +depends: + diff --git a/test_problems/cxx_ex/gri30.xml b/test_problems/cxx_ex/gri30.xml index ad168f908..fdbee1b26 100644 --- a/test_problems/cxx_ex/gri30.xml +++ b/test_problems/cxx_ex/gri30.xml @@ -18,50 +18,10 @@ 101325.0 - - - - - - - O H C N Ar - - H2 H O O2 OH H2O HO2 H2O2 C CH - CH2 CH2(S) CH3 CH4 CO CO2 HCO CH2O CH2OH CH3O - CH3OH C2H C2H2 C2H3 C2H4 C2H5 C2H6 HCCO CH2CO HCCOH - N NH NH2 NH3 NNH NO NO2 N2O HNO CN - HCN H2CN HCNN HCNO HOCN HNCO NCO N2 AR C3H7 - C3H8 CH2CHO CH3CHO - - - 300.0 - 101325.0 - - - + - - - O H C N Ar - - H2 H O O2 OH H2O HO2 H2O2 C CH - CH2 CH2(S) CH3 CH4 CO CO2 HCO CH2O CH2OH CH3O - CH3OH C2H C2H2 C2H3 C2H4 C2H5 C2H6 HCCO CH2CO HCCOH - N NH NH2 NH3 NNH NO NO2 N2O HNO CN - HCN H2CN HCNN HCNO HOCN HNCO NCO N2 AR C3H7 - C3H8 CH2CHO CH3CHO - - - 300.0 - 101325.0 - - - - - - diff --git a/test_problems/diamondSurf/Makefile.in b/test_problems/diamondSurf/Makefile.in index 8a0b45f92..597d84311 100644 --- a/test_problems/diamondSurf/Makefile.in +++ b/test_problems/diamondSurf/Makefile.in @@ -32,9 +32,6 @@ CXX = @CXX@ # C++ compile flags CXX_FLAGS = @CXXFLAGS@ -# external libraries -EXT_LIBS = @LOCAL_LIBS@ -lctcxx - # Ending C++ linking libraries LCXX_END_LIBS = @LCXX_END_LIBS@ @@ -42,7 +39,7 @@ LCXX_END_LIBS = @LCXX_END_LIBS@ CANTERA_LIBDIR=@buildlib@ # required Cantera libraries -CANTERA_LIBS = +CANTERA_LIBS = @LOCAL_LIBS@ -lctcxx # the directory where Cantera include files may be found. CANTERA_INCDIR=@ctroot@/build/include/cantera @@ -69,12 +66,12 @@ all: $(PROGRAM) # Rule to make the program $(PROGRAM): $(OBJS) $(CANTERA_LIBDIR)/libcantera.a - $(CXX) -o $(PROGRAM) $(OBJS) $(LCXX_FLAGS) $(CANTERA_LIBS) \ - $(LINK_OPTIONS) $(EXT_LIBS) @LIBS@ $(FORT_LIBS) \ + $(CXX) -o $(PROGRAM) $(OBJS) $(LCXX_FLAGS) $(LINK_OPTIONS) \ + $(CANTERA_LIBS) @LIBS@ $(FORT_LIBS) \ $(LCXX_END_LIBS) # depends target -depends: .depends +depends: $(RM) *.d .depends @MAKE@ .depends @@ -91,16 +88,3 @@ clean: $(RM) $(OBJS) $(PROGRAM) $(DEPENDS) .depends ../../bin/rm_cvsignore - - - - - - - - - - - - - diff --git a/test_problems/silane_equil/.cvsignore b/test_problems/silane_equil/.cvsignore index aa2b7ccb3..3859be165 100644 --- a/test_problems/silane_equil/.cvsignore +++ b/test_problems/silane_equil/.cvsignore @@ -3,3 +3,5 @@ diff_test.out output.txt silane_equil csvCode.txt +*.d +.depends diff --git a/test_problems/silane_equil/Makefile.in b/test_problems/silane_equil/Makefile.in index 74d9593d9..d7caf3f5e 100644 --- a/test_problems/silane_equil/Makefile.in +++ b/test_problems/silane_equil/Makefile.in @@ -7,6 +7,9 @@ # ############################################################################# +# addition to suffixes +.SUFFIXES : .d + # the name of the executable program to be created PROG_NAME = silane_equil @@ -29,9 +32,6 @@ CXX = @CXX@ # C++ compile flags CXX_FLAGS = @CXXFLAGS@ -# external libraries -EXT_LIBS = @LOCAL_LIBS@ -lctcxx - # Ending C++ linking libraries LCXX_END_LIBS = @LCXX_END_LIBS@ @@ -39,7 +39,7 @@ LCXX_END_LIBS = @LCXX_END_LIBS@ CANTERA_LIBDIR=@buildlib@ # required Cantera libraries -CANTERA_LIBS = +CANTERA_LIBS = @LOCAL_LIBS@ -lctcxx # the directory where Cantera include files may be found. CANTERA_INCDIR=@ctroot@/build/include/cantera @@ -47,24 +47,40 @@ CANTERA_INCDIR=@ctroot@/build/include/cantera # flags passed to the C++ compiler/linker for the linking step LCXX_FLAGS = -L$(CANTERA_LIBDIR) @CXXFLAGS@ -# how to compile C++ source files to object files +# How to compile C++ source files to object files .@CXX_EXT@.@OBJ_EXT@: $(CXX) -c $< -I$(CANTERA_INCDIR) $(CXX_FLAGS) +# How to compile the dependency file +.cpp.d: + g++ -MM -I$(CANTERA_INCDIR) $(CXX_FLAGS) $*.cpp > $*.d + +# List of dependency files to be created +DEPENDS=$(OBJS:.o=.d) + +# Program Name PROGRAM = $(PROG_NAME)$(EXE_EXT) all: $(PROGRAM) $(PROGRAM): $(OBJS) $(CANTERA_LIBDIR)/libcantera.a - $(CXX) -o $(PROGRAM) $(OBJS) $(LCXX_FLAGS) $(CANTERA_LIBS) \ - $(LINK_OPTIONS) $(EXT_LIBS) @LIBS@ $(FORT_LIBS) \ + $(CXX) -o $(PROGRAM) $(OBJS) $(LCXX_FLAGS) $(LINK_OPTIONS) \ + $(CANTERA_LIBS) @LIBS@ $(FORT_LIBS) \ $(LCXX_END_LIBS) +# depends target -> forces recalculation of dependencies +depends: + $(RM) *.d .depends + @MAKE@ .depends + +.depends: $(DEPENDS) + cat *.d > .depends + test: @MAKE@ $(PROGRAM) ./runtest clean: - $(RM) $(OBJS) $(PROGRAM) + $(RM) $(OBJS) $(PROGRAM) $(DEPENDS) .depends ../../bin/rm_cvsignore diff --git a/test_problems/silane_equil/silane_equil.cpp b/test_problems/silane_equil/silane_equil.cpp index 4b66d3f2e..0ae0e7f89 100644 --- a/test_problems/silane_equil/silane_equil.cpp +++ b/test_problems/silane_equil/silane_equil.cpp @@ -16,6 +16,7 @@ int main(int argc, char **argv) { try { IdealGasMix g("silane.xml", "silane"); g.setState_TPX(1500.0, 100.0, "SIH4:0.01, H2:0.99"); + //g.setState_TPX(1500.0, 1.0132E5, "SIH4:0.01, H2:0.99"); equilibrate(g, TP); cout << g; return 0; diff --git a/test_problems/surfkin/Makefile.in b/test_problems/surfkin/Makefile.in index 62b5a30c7..26b68a245 100644 --- a/test_problems/surfkin/Makefile.in +++ b/test_problems/surfkin/Makefile.in @@ -42,7 +42,7 @@ LCXX_END_LIBS = @LCXX_END_LIBS@ CANTERA_LIBDIR=@buildlib@ # required Cantera libraries -CANTERA_LIBS = +CANTERA_LIBS = @LOCAL_LIBS@ -lctcxx # the directory where Cantera include files may be found. CANTERA_INCDIR=@ctroot@/build/include/cantera @@ -65,14 +65,15 @@ PROGRAM = $(PROG_NAME)$(EXE_EXT) all: $(PROGRAM) $(PROGRAM): $(OBJS) $(CANTERA_LIBDIR)/libcantera.a - $(CXX) -o $(PROGRAM) $(OBJS) $(LCXX_FLAGS) $(CANTERA_LIBS) \ - $(LINK_OPTIONS) $(EXT_LIBS) @LIBS@ $(FORT_LIBS) \ + $(CXX) -o $(PROGRAM) $(OBJS) $(LCXX_FLAGS) $(LINK_OPTIONS) \ + $(CANTERA_LIBS) @LIBS@ $(FORT_LIBS) \ $(LCXX_END_LIBS) $(OBJS): -depends: $(DEPENDS) - cat *.d > .depends +depends: + $(RM) *.d .depends + @MAKE@ .depends .depends: $(DEPENDS) cat *.d > .depends