gray/Makefile

92 lines
3.2 KiB
Makefile
Raw Permalink Normal View History

2012-06-21 14:38:29 +02:00
# Executable name
EXE=gray
# Objects list
2015-11-18 17:34:33 +01:00
MAINOBJ=main.o
OTHOBJ= beamdata.o beams.o conical.o const_and_precisions.o coreprofiles.o \
dierckx.o dispersion.o eccd.o eierf.o errcodes.o graycore.o \
gray_params.o equilibrium.o limiter.o magsurf_data.o math.o minpack.o multipass.o \
numint.o pec.o polarization.o quadpack.o reflections.o simplespline.o units.o utils.o
2015-11-18 17:34:33 +01:00
2012-06-21 14:38:29 +02:00
# Alternative search paths
vpath %.f90 src
vpath %.f src
# Fortran compiler name and flags
FC=gfortran
LD=gfortran
FFLAGS=-O3 -fPIC
LDFLAGS= -static-libgfortran -static-libgcc
# LDFLAGS= -static-libgfortran -lgfortran -lgcc -lSystem -nodefaultlibs
LIBS= /usr/local/lib/libquadmath.a
# FFLAGS=-Wall -g -finit-real=nan -ffpe-trap=invalid -fcheck=all -fbounds-check
2012-06-21 14:38:29 +02:00
##
## Git information (used in the version string)
##
# Short hash of the latest commit
GIT_REV ?= $(shell git rev-parse --short HEAD)
# Whether the worktree and the latest commit differs
GIT_DIRTY ?= $(shell test -n "$$(git status --porcelain)" && echo "-dirty")
DIRECTIVES = -DREVISION=\"$(GIT_REV)$(GIT_DIRTY)\" -DPREFIX=\"$(PREFIX)\"
2012-06-29 15:53:20 +02:00
2012-06-21 14:38:29 +02:00
all: $(EXE)
# Build executable from object files
2015-11-18 17:34:33 +01:00
$(EXE): $(MAINOBJ) $(OTHOBJ)
$(LD) $(LDFLAGS) -o $@ $^ $(LIBS)
2012-06-21 14:38:29 +02:00
# Dependencies on modules
2015-11-18 17:34:33 +01:00
main.o: const_and_precisions.o beams.o coreprofiles.o equilibrium.o \
graycore.o gray_params.o reflections.o
graycore.o: const_and_precisions.o beamdata.o beams.o coreprofiles.o \
dispersion.o eccd.o equilibrium.o errcodes.o gray_params.o \
pec.o polarization.o limiter.o units.o utils.o reflections.o multipass.o
2015-11-18 17:34:33 +01:00
beams.o: const_and_precisions.o dierckx.o reflections.o simplespline.o utils.o
beamdata.o: const_and_precisions.o gray_params.o
conical.o: const_and_precisions.o
coreprofiles.o: const_and_precisions.o dierckx.o gray_params.o simplespline.o \
utils.o
dierckx.o: const_and_precisions.o
dispersion.o: const_and_precisions.o eierf.o errcodes.o math.o quadpack.o
eccd.o: const_and_precisions.o conical.o dierckx.o errcodes.o magsurf_data.o \
numint.o
2015-11-18 17:34:33 +01:00
eierf.o: const_and_precisions.o
errcodes.o: const_and_precisions.o
2015-11-18 17:34:33 +01:00
gray_params.o: const_and_precisions.o utils.o
equilibrium.o: const_and_precisions.o dierckx.o limiter.o minpack.o \
reflections.o simplespline.o utils.o gray_params.o
2015-11-18 17:34:33 +01:00
magsurf_data.o: const_and_precisions.o gray_params.o equilibrium.o dierckx.o \
reflections.o simplespline.o units.o utils.o
2015-11-18 17:34:33 +01:00
math.o: const_and_precisions.o
minpack.o: const_and_precisions.o
multipass.o: const_and_precisions.o beamdata.o equilibrium.o gray_params.o \
polarization.o reflections.o
2015-11-18 17:34:33 +01:00
numint.o: const_and_precisions.o
pec.o: const_and_precisions.o beamdata.o equilibrium.o gray_params.o \
magsurf_data.o utils.o
polarization.o: const_and_precisions.o
quadpack.o: const_and_precisions.o
reflections.o: const_and_precisions.o limiter.o utils.o
2015-11-18 17:34:33 +01:00
simplespline.o: const_and_precisions.o
utils.o: const_and_precisions.o
2012-06-21 14:38:29 +02:00
# General object compilation command
%.o: %.f90
2015-11-18 17:34:33 +01:00
$(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