36 lines
937 B
Makefile
36 lines
937 B
Makefile
|
COMP=gfortran
|
||
|
|
||
|
objects_src := dim_mod.f modules.f allocation.f spec.f
|
||
|
objects := $(patsubst %.f,%.o, $(objects_src))
|
||
|
|
||
|
OPTS := -g -Wall -Wextra -Warray-temporaries -Wconversion -fbacktrace -ffree-line-length-0 -fcheck=all -ffpe-trap=zero,overflow,underflow -finit-real=nan
|
||
|
|
||
|
EXE=prog
|
||
|
|
||
|
|
||
|
.PHONY: clean
|
||
|
|
||
|
all: pybinding clean
|
||
|
|
||
|
pybinding: $(objects) main.f
|
||
|
@echo "building Python binding..."
|
||
|
f2py3 -I. $(objects) -c -m libspec main.f
|
||
|
#f2py3 -I. $(objects) --debug-capi --debug -c -m libspec main.f
|
||
|
cp libspec.cpython*.so ../
|
||
|
|
||
|
exe: $(objects) prog.f
|
||
|
$(COMP) -c main.f
|
||
|
$(COMP) -c prog.f
|
||
|
$(COMP) -o $(EXE) $(objects) main.o prog.o
|
||
|
|
||
|
|
||
|
$(objects): $(objects_src)
|
||
|
@echo "compiling subroutines and functions..."
|
||
|
#$(COMP) -cpp -fPIC -O2 -ffast-math -mcmodel=large -fdefault-real-4 -c $^
|
||
|
$(COMP) $(OPTS) -fPIC -mcmodel=large -c $^
|
||
|
|
||
|
clean:
|
||
|
@echo "cleaning..."
|
||
|
rm -rf *.so *.o *.mod $(EXE)
|
||
|
|