-
Notifications
You must be signed in to change notification settings - Fork 6
/
makefile
113 lines (92 loc) · 4.27 KB
/
makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
##############################################################################
# Makefile for libhourssince.a
#
# User-specified flags are in this top block
#
###############################################################################
# This file is a component of the volcanic ash transport and dispersion model Ash3d,
# written at the U.S. Geological Survey by Hans F. Schwaiger ([email protected]),
# Larry G. Mastin ([email protected]), and Roger P. Denlinger ([email protected]).
# The model and its source code are products of the U.S. Federal Government and therefore
# bear no copyright. They may be copied, redistributed and freely incorporated
# into derivative products. However as a matter of scientific courtesy we ask that
# you credit the authors and cite published documentation of this model (below) when
# publishing or distributing derivative products.
# Schwaiger, H.F., Denlinger, R.P., and Mastin, L.G., 2012, Ash3d, a finite-
# volume, conservative numerical model for ash transport and tephra deposition,
# Journal of Geophysical Research, 117, B04204, doi:10.1029/2011JB008968.
# We make no guarantees, expressed or implied, as to the usefulness of the software
# and its documentation for any purpose. We assume no responsibility to provide
# technical support to users of this software.
# Sequence of commands:
# "make" compiles the libhourssince.a library
# "make all" builds the library, and the tools executables
# "make check" runs two test cases
# "make install" copies the library to the install location
# e.g. /opt/USGS
#
# SYSTEM specifies which compiler to use
# Current available options are:
# gfortran , ifort , aocc , nvhpc
# This variable cannot be left blank
#
SYSTEM = gfortran
SYSINC = make_$(SYSTEM).inc
#
# RUN specifies which collection of compilation flags that should be run
# Current available options are:
# DEBUG : includes debugging info and issues warnings
# PROF : includes profiling flags with some optimization
# OPT : includes optimizations flags for fastest runtime
# This variable cannot be left blank
#RUN = DEBUG
#RUN = PROF
RUN = OPT
INSTALLDIR=/opt/USGS
###############################################################################
##### END OF USER SPECIFIED FLAGS ###########################################
###############################################################################
###############################################################################
# Import the compiler-specific include file. Currently one of:
# GNU Fortran Compiler
# Intel Fortran Compiler
# AMD Optimizing C/C++/Fortran Compiler (aocc)
# Nvidia HPC Fortran Compiler (ncfortran)
include $(SYSINC)
###############################################################################
LIB = libhourssince.a
EXEC = \
HoursSince1900 \
yyyymmddhh_since_1900
###############################################################################
# TARGETS
###############################################################################
lib: $(LIB)
tools: $(EXEC)
test: testHours
all: libhourssince.a $(EXEC) makefile $(SYSINC) testHours
libhourssince.a: HoursSince.f90 HoursSince.o makefile $(SYSINC)
ar rcs libhourssince.a HoursSince.o
HoursSince.o: HoursSince.f90 makefile $(SYSINC)
$(FC) $(FFLAGS) $(EXFLAGS) $(LIBS) -c HoursSince.f90
HoursSince1900: HoursSince1900.f90 HoursSince.o $(SYSINC)
$(FC) $(FFLAGS) $(EXFLAGS) $(LIBS) HoursSince1900.f90 HoursSince.o -o HoursSince1900
yyyymmddhh_since_1900: yyyymmddhh_since_1900.f90 HoursSince.o
$(FC) $(FFLAGS) $(EXFLAGS) $(LIBS) yyyymmddhh_since_1900.f90 HoursSince.o -o yyyymmddhh_since_1900
testHours: testHours.f90 HoursSince.o makefile $(SYSINC)
$(FC) $(FFLAGS) $(EXFLAGS) $(LIBS) testHours.f90 HoursSince.o -o testHours
check: testHours HoursSince1900 makefile $(SYSINC)
bash check.sh
clean:
rm -f *.o *__genmod.f90 *__genmod.mod
rm -f libhourssince.a
rm -f $(EXEC) testHours
install:
install -d $(INSTALLDIR)/lib/
install -d $(INSTALLDIR)/bin/
install -m 644 $(LIB) $(INSTALLDIR)/lib/
install -m 755 $(EXEC) $(INSTALLDIR)/bin/
uninstall:
rm -f $(INSTALLDIR)/lib/$(LIB)
rm -f $(INSTALLDIR)/bin/HoursSince1900
rm -f $(INSTALLDIR)/bin/yyyymmddhh_since_1900