source: dynamico_lmdz/simple_physics/phyparam/Makefile @ 4240

Last change on this file since 4240 was 4236, checked in by dubos, 6 years ago

simple_physics : some Python bindings

File size: 1.4 KB
RevLine 
[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
8FFRONT ?= true
9
[4227]10F90 ?= gfortran
11F90FLAGS ?= -ffree-line-length-none
12
[4223]13NAMES = $(basename $(notdir $(wildcard physics/*.F90)))
14OBJECTS = $(addprefix obj/, $(addsuffix .o, $(NAMES)))
15
16all : obj $(OBJECTS) lib/libphyparam.so
17
[4236]18py : clean all
19        bash/extract_cython.sh
20        cd python ; rm -rf build *.c ; python setup.py build_ext --inplace
21        cd python ; python -c 'import phyparam as phys ; phys.setup(100.); phys.alloc(30,100) ; phys.coldstart(30, 100.)'
[4223]22obj :
[4235]23        @rm -rf obj include lib xml tmp *~ */*~
[4234]24        @mkdir obj include lib xml tmp
[4223]25
[4236]26clean : nice
[4235]27        @rm -rf obj include lib xml tmp *~ */*~
28        @mkdir obj include lib xml tmp
[4236]29        @bash/concatenate_all_code.sh $(NAMES) > tmp/all_code
30        @bash/makedeps.sh tmp/all_code >  Makefile.inc
[4233]31
32nice:
[4236]33        bash/beautify.sh physics/*.F90
[4233]34
[4223]35%.so : $(OBJECTS)
36        $(F90) -shared $^ -o $@ 
37
[4225]38SRC = $(basename $(notdir $@))
[4223]39obj/%.o: physics/%.F90
[4225]40        $(F90) -I include -fPIC $(F90FLAGS) -c $<
41        @mv $(SRC).mod include
42        @mv $(SRC).o obj
[4234]43        @cpp -DXCODEML $< > tmp/$(SRC).f90
44        @$(FFRONT) -M tmp tmp/$(SRC).f90 > xml/$(SRC).xml
45
[4235]46# dependencies between modules
47
48$(OBJECTS) : obj/logging.o
[4234]49-include Makefile.inc
Note: See TracBrowser for help on using the repository browser.