Skip to content
Snippets Groups Projects
Commit d5fc940f authored by kamischi's avatar kamischi
Browse files

Makefile: Update, fix & cleanup

parent f5531418
Branches
No related tags found
No related merge requests found
.SUFFIXES: .c .f .f90 .F90 .for .FOR .ftn .FTN .o .SUFFIXES: .f90 .F90 .o
# the fortran compiler # the fortran compiler
FC = gfortran FC = gfortran
...@@ -6,82 +6,40 @@ FC = gfortran ...@@ -6,82 +6,40 @@ FC = gfortran
# the options for the fortran compiler # the options for the fortran compiler
# FFLAGS = -fbounds-check # FFLAGS = -fbounds-check
# FFLAGS = -O3 -ff2c -gw # FFLAGS = -O3 -ff2c -gw
FFLAGS = -g -gdwarf-2 -fbounds-check -fcheck=all -fdiagnostics-color=auto FFLAGS = -g -gdwarf-2 -fbounds-check -fcheck=all
# gfortran version 4.8 does not know -fdiagnostics-color
# safeguard for major version >= 5
GFORTAN_VERSION_GT_5 := $(shell echo `gcc -dumpversion | cut -f1 -d. ` \>= 5 | bc)
ifeq "$(GFORTAN_VERSION_GT_5)" "1"
FFLAGS += -fdiagnostics-color=auto
endif
# fcat tool # fcat tool
FCAT = fcat FCAT = fcat
# Stuff for the python modules boson_all-fcat.f90: boson_all.f90
# Python3 and its numpy must be installed. $(FCAT) -count boson_all.f90 > boson_all-fcat.f90
PYTHON3 = python3 bosonf90: boson_all-fcat.f90
$(FC) $(FFLAGS) -o bosonf90 boson_all-fcat.f90
# the implicit rule for compiling for files eels_all-fcat.f90: eels_all.f90
# %.o: %.for ; $(FC) $(FFLAGS) -c -o $@ $< $(FCAT) -count eels_all.f90 > eels_all-fcat.f90
#%-fcat.f90: %.f90 ; fcat -count %.f90 > %-fcat.f90 eelsf90: eels_all-fcat.f90
%.o: %-fcat.f90 ; $(FC) $(FFLAGS) -c $< $(FC) $(FFLAGS) -o eelsf90 eels_all-fcat.f90
%_mod.mod: %.f90 ; $(FC) $(FFLAGS) -c $<
all: boson eels eels-boson pylibs all: eelsf90 bosonf90
bosonmods = sicot_mod.mod sintr_mod.mod rcffi_mod.mod
doboson-fcat.f90: doboson.f90
$(FCAT) -count doboson.f90 > doboson-fcat.f90
doboson.o: doboson-fcat.f90 $(bosonmods)
sicot_mod.mod: sintr_mod.mod
bosonsubs = doboson.o respon.o sicot.o sintr.o rcffi.o o1.o o2.o
boson-fcat.f90: boson.f90
$(FCAT) -count boson.f90 > boson-fcat.f90
boson: boson-fcat.f90 change_working_dir.o $(bosonsubs) $(bosonmods)
$(FC) $(FFLAGS) -o bosonf90 boson-fcat.f90 change_working_dir.o $(bosonsubs)
eelsmods = quanc8_mod.mod queels_mod.mod seteps_mod.mod
doeels-fcat.f90: doeels.f90
$(FCAT) -count doeels.f90 > doeels-fcat.f90
doeels.o: doeels-fcat.f90 $(eelsmods)
queels_mod.mod: quanc8_mod.mod fint1_mod.mod fint2_mod.mod fint3_mod.mod
quanc8_mod.mod: fun_mod.mod
fint1_mod.mod: surlos_mod.mod
fint2_mod.mod: surlos_mod.mod
fint3_mod.mod: surlos_mod.mod
eelssubs = doeels.o usurlo.o quanc8.o fun.o queels.o fint1.o fint2.o fint3.o surlos.o seteps.o phint.o qrat.o
eels-fcat.f90: eels.f90
$(FCAT) -count eels.f90 > eels-fcat.f90
eels: eels-fcat.f90 change_working_dir.o $(eelssubs) $(eelsmods)
$(FC) $(FFLAGS) -o eelsf90 eels-fcat.f90 change_working_dir.o $(eelssubs)
eels-boson: eels-boson.f90 change_working_dir.o $(eelssubs) $(eelsmods) $(bosonsubs) $(bosonmods)
$(FC) $(FFLAGS) -o eels-boson eels-boson.f90 change_working_dir.o $(eelssubs) $(bosonsubs)
pylibs: doeels-py doboson-py
doeels-py: doeels.f90 quanc8.f90 surlos.f90 fint1.f90 fint2.f90 fint3.f90 queels.f90 phint.f90 qrat.f90 usurlo.f90
$(PYTHON3) -m numpy.f2py -c seteps.f90 doeels.f90 quanc8.f90 surlos.f90 fint1.f90 fint2.f90 fint3.f90 queels.f90 phint.f90 qrat.f90 usurlo.f90 -m doeels
doboson-py: doboson.f90 sicot.f90 sintr.f90 rcffi.f90 respon.f90 o1.f90 o2.f90
$(PYTHON3) -m numpy.f2py -c o1.f90 o2.f90 sintr.f90 rcffi.f90 respon.f90 sicot.f90 doboson.f90 -m doboson
fcat: eelsf90 bosonf90
./eelsf90 > eelsf90_fcat_output ./eelsf90 > eelsf90_fcat_output
fcat -count eels.f90 eelsf90_fcat_output fcat -count eels_all.f90 eelsf90_fcat_output > eels_all.f90.fcat-analysis.txt
# fcat -report eels.f90 eelsf90_fcat_output
./bosonf90 > bosonf90_fcat_output ./bosonf90 > bosonf90_fcat_output
fcat -count boson.f90 bosonf90_fcat_output fcat -count boson_all.f90 bosonf90_fcat_output > boson_all.f90.fcat-analysis.txt
fcat -count doboson.f90 bosonf90_fcat_output
# fcat -report boson.f90 bosonf90_fcat_output
clean: clean:
rm -f *.o
rm -rf *.dSYM rm -rf *.dSYM
rm -rf *.mod rm -rf *mod.mod
rm -rf *.so rm -rf *_all-fcat.f90
rm -rf *-fcat.*
rm -f bosonf90 bosonf90.exe rm -f bosonf90 bosonf90.exe
rm -f eelsf90 eelsf90.exe rm -f eelsf90 eelsf90.exe
rm -f eels-boson eels-boson.exe rm -rf *_all.f90.fcat-analysis.txt
.PHONY: all clean pylibs fcat .PHONY: all clean
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment