gray/Makefile.single

168 lines
3.9 KiB
Makefile

# Executable name
EXE=gray-single
# Objects list
OBJ= gray-single.o gray_main.o gray-externals.o grayl.o beamdata.o \
const_and_precisions.o green_func_p.o reflections.o scatterspl.o \
dispersion.o calcei.o dqagmv.o
# Alternative search paths
vpath %.f90 src
vpath %.f src
########################################
# Set up compiler specific environment #
########################################
# set default compiler
# --------------------
FC=gfortran
# Set compiler debug and optimization flags
# -----------------------------------------
FFLAGS= -O0 -finit-real=nan -fcheck=all
#####################################
# Set up RULES specific environment #
#####################################
DIRECTIVES = -DREVISION="'$(shell svnversion src)'"
# suffixes
# --------
.SUFFIXES: .f90 .f .o .mod
# PHONY targets
# -------------
.PHONY: clean install
all: $(EXE)
# Build executable from object files
$(EXE): $(OBJ)
$(FC) $(FFLAGS) -o $@ $^
# create rule for compiling f90 files
# -----------------------------------
%.o: %.f90
$(FC) -c $(FFLAGS) $<
# create rule for compiling f files
# ---------------------------------
%.o: %.f
$(FC) -c $(FFLAGS) $<
# create rule for files requiring preprocessing
gray-externals.o: gray-externals.f
$(FC) -cpp $(DIRECTIVES) $(FFLAGS) -c $<
# make 'clean' option
# -------------------
clean:
rm -rf *.o *.mod $(EXE)
# Dependencies
# ------------
gray-single.o: gray_main.o grayl.o
gray_main.o: const_and_precisions.o
gray-externals.o: green_func_p.o reflections.o beamdata.o const_and_precisions.o dispersion.o
green_func_p.o: const_and_precisions.o
scatterspl.o: const_and_precisions.o
beamdata.o: const_and_precisions.o
dispersion.o: calcei.o dqagmv.o
## library name
## ------------
#LIBNAME=$(JLIBDIR)/libgray.a
#
## List source and object files
## ----------------------------
#FSRC=$(wildcard *.f *.f90)
#FOBJ0=$(FSRC:.f=.o)
#FOBJ=$(FOBJ0:.f90=.o)
#
#########################################
## Set up compiler specific environment #
#########################################
## set default compiler
## --------------------
#FC=$(F90)
#
## Set compiler debug and optimization flags
## -----------------------------------------
#ifeq ("$(DBG)","")
# FFLAGS= $(AUTO) -O3
#else
# FFLAGS= $(AUTO) -O0 -g -Minform=inform -Mbounds -Mchkptr
#endif
#
## Set include directories
## -----------------------
##INC=-I$(JCOMMON_STD)
#INC=
#
######################################
## Set up RULES specific environment #
######################################
#
## suffixes
## --------
#.SUFFIXES: .f90 .f .o .mod
#
## PHONY targets
## -------------
#.PHONY: all clean realclean $(MASTER_RULES) gray
#
## default target
## --------------
#all:
# @($(MAKE) -C ../ all) || exit $$?
#
## Set rules passed to top-level Makefile
## --------------------------------------
#$(MASTER_RULES):
# @($(MAKE) -C ../ $@) || exit $$?
#
## rule for libgray.a
## --------------------
#$(LIBNAME): $(FOBJ)
# ar vr $(LIBNAME) $?
#
## synonym for libgray.a
## -----------------------
#gray: $(LIBNAME)
#
## create rule for compiling f90 files
## -----------------------------------
#%.o: %.f90
# $(FC) -c $(FFLAGS) $(INC) $<
#
## create rule for compiling f files
## ---------------------------------
#%.o: %.f
# $(FC) -c $(FFLAGS) $(INC) $<
#
## make 'realclean' option
## -----------------------
#realclean:
# rm -f *.o *.mod $(LIBNAME)
#
## make 'clean' option
## -------------------
#clean:
# rm -f *.o
#
## Dependencies
## ------------
#gray_main.o: const_and_precisions.o
#gray-externals.o: green_func_p.o reflections.o beamdata.o const_and_precisions.o
#green_func_p.o: const_and_precisions.o
#scatterspl.o: const_and_precisions.o
#beamdata.o: const_and_precisions.o
#
## Special rule to preprocess source file and include svn revision
## ---------------------------------------------------------------
#DIRECTIVES = -DREVISION="'$(shell svnversion)'"
#gray-externals.o:gray-externals.f
# $(FC) -c -Mpreprocess $(DIRECTIVES) $(FFLAGS) $(INC) $<