gray/Makefile

51 lines
1022 B
Makefile
Raw Normal View History

2012-06-21 14:38:29 +02:00
# Executable name
EXE=gray
# Objects list
OBJ=gray.o grayl.o reflections.o green_func_p.o \
const_and_precisions.o itm_constants.o itm_types.o singleton.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
FFLAGS=-O3 -fcheck=all
2012-06-21 14:38:29 +02: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
$(EXE): $(OBJ)
$(FC) $(FFLAGS) -o $@ $^
# Dependencies on modules
gray.o: green_func_p.o reflections.o singleton.o
2012-06-21 14:38:29 +02:00
green_func_p.o: const_and_precisions.o
const_and_precisions.o: itm_types.o itm_constants.o
itm_constants.o: itm_types.o
# General object compilation command
%.o: %.f90
$(FC) $(FFLAGS) -c $<
gray.o:gray.f green_func_p.o
2012-06-29 15:53:20 +02:00
$(FC) -cpp $(DIRECTIVES) $(FFLAGS) -c $<
2012-06-21 14:38:29 +02:00
grayl.o:grayl.f
$(FC) $(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