# Executable name EXE=gray # Objects list MAINOBJ=gray.o OTHOBJ=dispersion.o calcei_mod.o dqagmv.o grayl.o reflections.o green_func_p.o \ const_and_precisions.o graydata_flags.o graydata_par.o graydata_anequil.o \ magsurf_data.o interp_eqprof.o # Alternative search paths vpath %.f90 src vpath %.f src # Fortran compiler name and flags FC=gfortran FFLAGS=-O3 #-Wall -g -fcheck=all DIRECTIVES = -DREVISION="'$(shell svnversion src)'" all: $(EXE) # Build executable from object files $(EXE): $(MAINOBJ) $(OTHOBJ) $(FC) $(FFLAGS) -o $@ $^ # Dependencies on modules gray.o: dispersion.o dqagmv.o green_func_p.o reflections.o const_and_precisions.o \ graydata_flags.o graydata_par.o graydata_anequil.o magsurf_data.o interp_eqprof.o green_func_p.o: const_and_precisions.o reflections.o: const_and_precisions.o dispersion.o: calcei_mod.o dqagmv.o graydata_flags.o: const_and_precisions.o graydata_par.o: const_and_precisions.o graydata_anequil.o: const_and_precisions.o magsurf_data.o: const_and_precisions.o interp_eqprof.o: const_and_precisions.o # General object compilation command %.o: %.f90 $(FC) $(FFLAGS) -c $< %.o: %.f $(FC) $(FFLAGS) -c $< gray.o:gray.f $(FC) -cpp $(DIRECTIVES) $(FFLAGS) -c $< .PHONY: clean install # Remove output files clean: rm -rf *.o *.mod $(EXE) install: @if [ -f $(EXE) ]; then \ cp $(EXE) ~/bin/; \ else \ echo File $(EXE) does not exist. Run \'make\' first; \ fi