2012-06-21 14:38:29 +02:00
|
|
|
# Executable name
|
|
|
|
EXE=gray
|
|
|
|
|
|
|
|
# Objects list
|
2015-05-13 15:19:29 +02:00
|
|
|
MAINOBJ=gray.o
|
|
|
|
OTHOBJ=dqagmv.o grayl.o reflections.o green_func_p.o \
|
2015-05-15 18:02:27 +02:00
|
|
|
const_and_precisions.o
|
2012-06-21 14:38:29 +02:00
|
|
|
|
|
|
|
# Alternative search paths
|
|
|
|
vpath %.f90 src
|
|
|
|
vpath %.f src
|
|
|
|
|
|
|
|
# Fortran compiler name and flags
|
|
|
|
FC=gfortran
|
2015-05-13 15:19:29 +02:00
|
|
|
FFLAGS=-O3 #-Wall -g -fcheck=all
|
2012-06-21 14:38:29 +02:00
|
|
|
|
2012-11-16 18:16:01 +01:00
|
|
|
DIRECTIVES = -DREVISION="'$(shell svnversion src)'"
|
2012-06-29 15:53:20 +02:00
|
|
|
|
2012-06-21 14:38:29 +02:00
|
|
|
all: $(EXE)
|
|
|
|
|
|
|
|
# Build executable from object files
|
2015-05-13 15:19:29 +02:00
|
|
|
$(EXE): $(MAINOBJ) $(OTHOBJ)
|
2012-06-21 14:38:29 +02:00
|
|
|
$(FC) $(FFLAGS) -o $@ $^
|
|
|
|
|
|
|
|
# Dependencies on modules
|
2015-05-15 18:02:27 +02:00
|
|
|
gray.o: dqagmv.o green_func_p.o reflections.o const_and_precisions.o
|
2012-06-21 14:38:29 +02:00
|
|
|
green_func_p.o: const_and_precisions.o
|
2015-05-15 18:02:27 +02:00
|
|
|
reflections.o: const_and_precisions.o
|
2012-06-21 14:38:29 +02:00
|
|
|
|
|
|
|
# General object compilation command
|
|
|
|
%.o: %.f90
|
2015-05-15 18:02:27 +02:00
|
|
|
$(FC) $(FFLAGS) -c $<
|
2012-06-21 14:38:29 +02:00
|
|
|
|
2015-05-13 15:19:29 +02:00
|
|
|
%.o: %.f
|
2015-05-15 18:02:27 +02:00
|
|
|
$(FC) $(FFLAGS) -c $<
|
2012-06-21 14:38:29 +02:00
|
|
|
|
2015-05-13 15:19:29 +02:00
|
|
|
gray.o:gray.f
|
|
|
|
$(FC) -cpp $(DIRECTIVES) $(FFLAGS) -c $<
|
2012-06-21 14:38:29 +02:00
|
|
|
|
|
|
|
.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
|