2014-06-13 01:13:32 +02:00
|
|
|
# Makefile for JETTO fortran 90 library 'gray'
|
|
|
|
# Author: Lorenzo Figini (figini@ifp.cnr.it)
|
2014-06-11 12:05:33 +02:00
|
|
|
#
|
|
|
|
# Derived from
|
2014-06-13 01:13:32 +02:00
|
|
|
# Makefile for JETTO fortran 77 library 'frantic'
|
|
|
|
# Author: Derek Harting (d.harting@fz-juelich.de)
|
2014-06-11 12:05:33 +02:00
|
|
|
# and
|
|
|
|
# Makefile for ITCequ Fortran 90 library - definitions
|
|
|
|
# P. Strand, elfps@chalmers.se
|
|
|
|
# G. Corrigan, gcor@jet.uk
|
|
|
|
# D. Harting, d.harting@fz-juelich.de
|
2014-06-13 01:13:32 +02:00
|
|
|
# Set the environment from the top-level Makefile of JETTO
|
|
|
|
# --------------------------------------------------------
|
|
|
|
include ../include.mk
|
2012-06-21 14:38:29 +02:00
|
|
|
|
2014-06-11 12:05:33 +02:00
|
|
|
# library name
|
2014-06-13 01:13:32 +02:00
|
|
|
# ------------
|
2014-06-11 12:05:33 +02:00
|
|
|
LIBNAME=$(JLIBDIR)/libgray.a
|
2012-06-21 14:38:29 +02:00
|
|
|
|
2014-06-13 01:13:32 +02:00
|
|
|
# List source and object files
|
|
|
|
# ----------------------------
|
|
|
|
FSRC=$(wildcard *.f *.f90)
|
|
|
|
FOBJ0=$(FSRC:.f=.o)
|
|
|
|
FOBJ=$(FOBJ0:.f90=.o)
|
2012-06-21 14:38:29 +02:00
|
|
|
|
2014-06-13 01:13:32 +02:00
|
|
|
########################################
|
|
|
|
# Set up compiler specific environment #
|
|
|
|
########################################
|
2014-06-11 12:05:33 +02:00
|
|
|
# set default compiler
|
|
|
|
# --------------------
|
|
|
|
FC=$(F90)
|
2012-06-21 14:38:29 +02:00
|
|
|
|
2014-06-13 01:13:32 +02:00
|
|
|
# Set compiler debug and optimization flags
|
|
|
|
# -----------------------------------------
|
|
|
|
ifeq ("$(DBG)","")
|
|
|
|
FFLAGS= $(AUTO) -O3
|
|
|
|
else
|
|
|
|
FFLAGS= $(AUTO) -O0 -g
|
|
|
|
endif
|
|
|
|
|
|
|
|
# Set include directories
|
|
|
|
# -----------------------
|
|
|
|
#INC=-I$(JCOMMON_STD)
|
2014-06-11 12:05:33 +02:00
|
|
|
INC=
|
2014-06-13 01:13:32 +02:00
|
|
|
|
|
|
|
#####################################
|
|
|
|
# Set up RULES specific environment #
|
|
|
|
#####################################
|
2012-06-21 14:38:29 +02:00
|
|
|
|
2014-06-11 12:05:33 +02:00
|
|
|
# suffixes
|
2014-06-13 01:13:32 +02:00
|
|
|
# --------
|
2014-06-11 12:05:33 +02:00
|
|
|
.SUFFIXES: .f90 .f .o .mod
|
2012-06-21 14:38:29 +02:00
|
|
|
|
2014-06-13 01:13:32 +02:00
|
|
|
# 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
|
2014-06-10 10:14:14 +02:00
|
|
|
|
2014-06-11 12:05:33 +02:00
|
|
|
# Dependencies
|
|
|
|
# ------------
|
2014-06-10 10:14:14 +02:00
|
|
|
gray_main.o: gray-externals.o itm_types.o
|
2014-06-13 17:12:36 +02:00
|
|
|
gray-externals.o: green_func_p.o reflections.o scatterspl.o beamdata.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
|
2014-06-13 01:13:32 +02:00
|
|
|
scatterspl.o: itm_types.o
|
2014-06-13 17:12:36 +02:00
|
|
|
beamdata.o: itm_types.o
|
2012-06-21 14:38:29 +02:00
|
|
|
|
2014-06-11 12:05:33 +02:00
|
|
|
# Special rule to preprocess source file and include svn revision
|
|
|
|
# ---------------------------------------------------------------
|
|
|
|
DIRECTIVES = -DREVISION="'$(shell svnversion)'"
|
2014-06-10 10:14:14 +02:00
|
|
|
gray-externals.o:gray-externals.f
|
2014-06-13 01:13:32 +02:00
|
|
|
$(FC) -c -Mpreprocess $(DIRECTIVES) $(FFLAGS) $(INC) $<
|