Makefile 995 Bytes
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33

camelot : F90=mpif90
camelot : F90FLAGS=-I ../dynamico/inc -i4 -r8 -auto -align all -assume realloc_lhs
camelot : NCFLAGS=-L/opt/netcdf4/4.4.1.1-parallel/ifort/lib -lnetcdff -Wl,-rpath -Wl,/opt/netcdf4/4.4.1.1-parallel/ifort/lib -lnetcdf
camelot : ICOFLAGS=-L ../dynamico/lib -licosa -L${MKLROOT}/lib/intel64 -lmkl_intel_lp64 -lmkl_sequential -lmkl_core -lm
camelot : XIOSFLAGS=-L ../XIOS/lib -licosa -lxios -lstdc++
camelot : LDFLAGS=$(ICOFLAGS) $(XIOSFLAGS) $(NCFLAGS)
camelot : all

all :
	. ../dynamico/arch.env && module list && F90="$(F90)" F90FLAGS="$(F90FLAGS)" LDFLAGS="$(LDFLAGS)" make a.out

clean :
	@rm -rf obj include bin *~ */*~
	@mkdir obj include bin


%.so : $(OBJECTS)
	$(F90) -shared $^ -o $@ 

SRC = $(basename $(notdir $@))

a.out : obj/driver.o
	$(F90) obj/driver.o obj/emission.o $(LDFLAGS)
	mv a.out bin/DYNAMICO_emission.exe

obj/driver.o : obj/emission.o

obj/%.o: src/%.F90
	$(F90) -I include -fPIC $(F90FLAGS) -c $<
	mv $(SRC).o obj
	mv $(SRC).mod include || true