[4226] | 1 | # known to compile with gfortran version 7, ifort version 17, pgfortran version 18 |
---|
| 2 | # Examples |
---|
[4227] | 3 | # F90=ifort FFLAGS=-fast make clean all |
---|
| 4 | # F90=gfortran F90FLAGS=-ffree-line-length-none make clean all |
---|
| 5 | # F90=pgfortran F90FLAGS="-fast -Minfo=loop" make clean all |
---|
[4224] | 6 | |
---|
[4225] | 7 | # if XCodeML F_Front is installed, set FFRONT=F_Front to parse code into XML |
---|
| 8 | FFRONT ?= true |
---|
| 9 | |
---|
[4227] | 10 | F90 ?= gfortran |
---|
| 11 | F90FLAGS ?= -ffree-line-length-none |
---|
| 12 | |
---|
[4223] | 13 | NAMES = $(basename $(notdir $(wildcard physics/*.F90))) |
---|
| 14 | OBJECTS = $(addprefix obj/, $(addsuffix .o, $(NAMES))) |
---|
| 15 | |
---|
| 16 | all : obj $(OBJECTS) lib/libphyparam.so |
---|
| 17 | |
---|
[4236] | 18 | py : clean all |
---|
| 19 | bash/extract_cython.sh |
---|
| 20 | cd python ; rm -rf build *.c ; python setup.py build_ext --inplace |
---|
[4223] | 21 | obj : |
---|
[4235] | 22 | @rm -rf obj include lib xml tmp *~ */*~ |
---|
[4234] | 23 | @mkdir obj include lib xml tmp |
---|
[4223] | 24 | |
---|
[4236] | 25 | clean : nice |
---|
[4235] | 26 | @rm -rf obj include lib xml tmp *~ */*~ |
---|
| 27 | @mkdir obj include lib xml tmp |
---|
[4236] | 28 | @bash/concatenate_all_code.sh $(NAMES) > tmp/all_code |
---|
| 29 | @bash/makedeps.sh tmp/all_code > Makefile.inc |
---|
[4233] | 30 | |
---|
| 31 | nice: |
---|
[4236] | 32 | bash/beautify.sh physics/*.F90 |
---|
[4233] | 33 | |
---|
[4223] | 34 | %.so : $(OBJECTS) |
---|
| 35 | $(F90) -shared $^ -o $@ |
---|
| 36 | |
---|
[4225] | 37 | SRC = $(basename $(notdir $@)) |
---|
[4223] | 38 | obj/%.o: physics/%.F90 |
---|
[4225] | 39 | $(F90) -I include -fPIC $(F90FLAGS) -c $< |
---|
| 40 | @mv $(SRC).mod include |
---|
| 41 | @mv $(SRC).o obj |
---|
[4234] | 42 | @cpp -DXCODEML $< > tmp/$(SRC).f90 |
---|
| 43 | @$(FFRONT) -M tmp tmp/$(SRC).f90 > xml/$(SRC).xml |
---|
| 44 | |
---|
[4235] | 45 | # dependencies between modules |
---|
| 46 | |
---|
| 47 | $(OBJECTS) : obj/logging.o |
---|
[4234] | 48 | -include Makefile.inc |
---|