diff --git a/ext/Makefile.in b/ext/Makefile.in index dce908022..3ab83ecc3 100755 --- a/ext/Makefile.in +++ b/ext/Makefile.in @@ -1,11 +1,35 @@ - +#/bin/sh +# +# $Source$ +# $Author$ +# $Revision$ +# $Date$ +# +# Makefile for ext directory +# BUILD_LAPACK=@build_lapack@ BUILD_BLAS=@build_blas@ +BUILD_WITH_F2C=@build_with_f2c@ LIBS = blas/libctblas.a lapack/libctlapack.a math/libctmath.a \ recipes/librecipes.a cvode/libcvode.a tpx/libtpx.a -all: +all: +ifeq ($(BUILD_WITH_F2C),1) + cd f2c_libs; @MAKE@ +ifeq ($(BUILD_LAPACK),1) + cd f2c_lapack; @MAKE@ +else + cd f2c_lapack; @MAKE@ clean +endif +ifeq ($(BUILD_BLAS),1) + cd f2c_blas; @MAKE@ +else + cd f2c_blas; @MAKE@ clean +endif + cd f2c_recipes; @MAKE@ + cd f2c_math; @MAKE@ +else ifeq ($(BUILD_LAPACK),1) cd lapack; @MAKE@ else @@ -17,9 +41,10 @@ else cd blas; @MAKE@ clean endif cd recipes; @MAKE@ - cd cvode; @MAKE@ cd math; @MAKE@ - cd tpx; @MAKE@ +endif + cd cvode; @MAKE@ + cd tpx; @MAKE@ clean: cd lapack; @MAKE@ clean @@ -28,6 +53,44 @@ clean: cd cvode; @MAKE@ clean cd math; @MAKE@ clean cd tpx; @MAKE@ clean + (if test -d "f2c_libs" ; then \ + cd f2c_libs ; @MAKE@ clean ; \ + fi) + (if test -d "f2c_lapack" ; then \ + cd f2c_lapack ; @MAKE@ clean ; \ + fi) + (if test -d "f2c_blas" ; then \ + cd f2c_blas ; @MAKE@ clean ; \ + fi) + (if test -d "f2c_math" ; then \ + cd f2c_math ; @MAKE@ clean ; \ + fi) + (if test -d "f2c_recipes" ; then \ + cd f2c_recipes ; @MAKE@ clean ; \ + fi) -install: - @INSTALL@ -m 644 $(LIBS) @prefix@/lib +depends: +ifeq ($(BUILD_WITH_F2C),1) + (if test -d "f2c_libs" ; then \ + cd f2c_libs ; @MAKE@ depends ; \ + fi) + (if test -d "f2c_lapack" ; then \ + cd f2c_lapack ; @MAKE@ depends ; \ + fi) + (if test -d "f2c_blas" ; then \ + cd f2c_blas ; @MAKE@ depends ; \ + fi) + (if test -d "f2c_math" ; then \ + cd f2c_math ; @MAKE@ depends ; \ + fi) + (if test -d "f2c_recipes" ; then \ + cd f2c_recipes ; @MAKE@ depends ; \ + fi) +else + cd lapack; @MAKE@ depends + cd blas; @MAKE@ depends + cd recipes; @MAKE@ depends + cd math; @MAKE@ depends +endif + cd cvode; @MAKE@ depends + cd tpx; @MAKE@ depends diff --git a/ext/blas/Makefile.in b/ext/blas/Makefile.in index 591f17f83..7fed9c677 100755 --- a/ext/blas/Makefile.in +++ b/ext/blas/Makefile.in @@ -65,6 +65,5 @@ $(BLASLIB): $(OBJS) clean: $(RM) $(OBJS) $(BLASLIB) - - +depends: diff --git a/ext/cvode/Makefile.in b/ext/cvode/Makefile.in index 6b87bfb5d..934037046 100755 --- a/ext/cvode/Makefile.in +++ b/ext/cvode/Makefile.in @@ -89,5 +89,5 @@ clean: $(RM) ./libcvode.a $(RM) $(OBJS) - +depends: diff --git a/ext/f2c_blas/Makefile.in b/ext/f2c_blas/Makefile.in index 4e31e7d41..29caa4fe8 100755 --- a/ext/f2c_blas/Makefile.in +++ b/ext/f2c_blas/Makefile.in @@ -11,7 +11,6 @@ .SUFFIXES : .SUFFIXES : .c .d .o - # the directory where the Cantera libraries are located CANTERA_LIBDIR=@buildlib@ @@ -110,3 +109,8 @@ depends: .depends: $(DEPENDS) cat *.d > .depends + +ifeq ($(wildcard .depends), .depends) +include .depends +endif + diff --git a/ext/f2c_libs/Makefile.in b/ext/f2c_libs/Makefile.in index e3367bf83..89909f078 100755 --- a/ext/f2c_libs/Makefile.in +++ b/ext/f2c_libs/Makefile.in @@ -18,7 +18,7 @@ # -fPIC # to the CFLAGS = line below. -.SUFFIXES: .c .o +.SUFFIXES: .c .o .d # the C compiler CC = @CC@ @@ -28,10 +28,12 @@ CFLAGS = @CXXFLAGS@ $(CXX_OPT) # Destination f2c lib located in Cantera's build directory # -> Calling it ctf2c +BUILDINCDIR=../../build/include/cantera F2C_LIB = @buildlib@/libctf2c.a +F2C_H = $(BUILDINCDIR)/f2c.h # compile, then strip unnecessary symbols -.c.o: +.c.o: f2c.h $(CC) -c -DSkip_f2c_Undefs $(CFLAGS) $*.c ld -r -x -o $*.xxx $*.o mv $*.xxx $*.o @@ -83,12 +85,16 @@ TIME = dtime_.o etime_.o OFILES = $(MISC) $(POW) $(CX) $(DCX) $(REAL) $(DBL) $(INT) \ $(HALF) $(CMP) $(EFL) $(CHAR) $(I77) $(TIME) -all: f2c.h signal1.h sysdep1.h $(F2C_LIB) +all: f2c.h signal1.h sysdep1.h $(F2C_LIB) $(F2C_H) $(F2C_LIB): $(OFILES) ar r $(F2C_LIB) $? -ranlib $(F2C_LIB) +$(F2C_H): f2c.h + @INSTALL@ -d $(BUILDINCDIR) + @INSTALL@ f2c.h $(F2C_H) + ### If your system lacks ranlib, you don't need it; see README. f77vers.o: f77vers.c @@ -122,11 +128,10 @@ sysdep1.h: sysdep1.h0 #main.o: main.c # $(CC) -c -Donexit=on_exit -DSkip_f2c_Undefs main.c - - clean: - $(RM) $(F2C_LIB) *.o arith.h signal1.h sysdep1.h + $(RM) $(F2C_LIB) *.o *.d arith.h signal1.h sysdep1.h $(F2C_H) +$(OFILES): f2c.h backspac.o: fio.h close.o: fio.h dfe.o: fio.h @@ -187,3 +192,6 @@ arith.h: arithchk.c ./a.out >arith.h rm -f a.out arithchk.o +# depends target -> already in the Makefile +depends: + diff --git a/ext/f2c_math/Makefile.in b/ext/f2c_math/Makefile.in index d84db0fdd..56570ae2a 100644 --- a/ext/f2c_math/Makefile.in +++ b/ext/f2c_math/Makefile.in @@ -94,3 +94,7 @@ depends: .depends: $(DEPENDS) cat *.d > .depends +ifeq ($(wildcard .depends), .depends) +include .depends +endif + diff --git a/ext/lapack/Makefile.in b/ext/lapack/Makefile.in index 0a7a82ee2..7610eaca0 100755 --- a/ext/lapack/Makefile.in +++ b/ext/lapack/Makefile.in @@ -1,4 +1,5 @@ # $License$ +# $Id$ # #/bin/sh @@ -71,19 +72,6 @@ $(LAPACKLIB): $(OBJS) %.o : %.f @F77@ -c $< $(F77_INCLUDES) $(F_FLAGS) - - clean: $(RM) $(OBJS) $(LAPACKLIB) - - - - - - - - - - - - +depends: diff --git a/ext/tpx/.cvsignore b/ext/tpx/.cvsignore index 550bd25cd..b39c0d1a8 100644 --- a/ext/tpx/.cvsignore +++ b/ext/tpx/.cvsignore @@ -1,2 +1,3 @@ Makefile +.depends diff --git a/ext/tpx/Makefile.in b/ext/tpx/Makefile.in index 2efe9af98..e786d24f3 100755 --- a/ext/tpx/Makefile.in +++ b/ext/tpx/Makefile.in @@ -32,12 +32,13 @@ $(TPLIB): $(COBJS) $(FOBJS) @ARCHIVE@ $(TPLIB) $(COBJS) $(FOBJS) > /dev/null clean: - $(RM) $(COBJS) $(FOBJS) *~ + $(RM) $(COBJS) $(FOBJS) *~ *.d .depends depends: $(DEPENDS) cat *.d > .depends $(RM) $(DEPENDS) +ifeq ($(wildcard .depends), .depends) include .depends - +endif