mirror of
https://github.com/Cantera/cantera.git
synced 2025-02-25 18:55:29 -06:00
Fixed makefiles within the ext directory.
Added support for build_with_f2c.
This commit is contained 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
|
||||
|
||||
@@ -65,6 +65,5 @@ $(BLASLIB): $(OBJS)
|
||||
clean:
|
||||
$(RM) $(OBJS) $(BLASLIB)
|
||||
|
||||
|
||||
|
||||
depends:
|
||||
|
||||
|
||||
@@ -89,5 +89,5 @@ clean:
|
||||
$(RM) ./libcvode.a
|
||||
$(RM) $(OBJS)
|
||||
|
||||
|
||||
depends:
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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:
|
||||
|
||||
|
||||
@@ -94,3 +94,7 @@ depends:
|
||||
.depends: $(DEPENDS)
|
||||
cat *.d > .depends
|
||||
|
||||
ifeq ($(wildcard .depends), .depends)
|
||||
include .depends
|
||||
endif
|
||||
|
||||
|
||||
@@ -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:
|
||||
|
||||
@@ -1,2 +1,3 @@
|
||||
Makefile
|
||||
.depends
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user