-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathgmakefile
105 lines (92 loc) · 3.64 KB
/
gmakefile
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
# Makefile for program - HSPF Version 11
#
# History: 95/09/22 thjobes
# Usage: make [BINDIR=path_to_install_to] [install] [| tee makeout]
#
# Examples: make
# make install BINDIR=/usr/opt/bin
# make install BINDIR=$HOME/bin
# Compiler flags (Fortran - Green Hills):
# C - check subranges and array bounds
# u - default data type for undeclareds is undefined
# g - generate source level symbolic debug information
# OM - optimization
# (NOTE: set OpgDbg to: OptM to generate optimized code
# DbgF to generate debug code)
DbgF = -g
OptM = -OM
OptDbg = $(OptM)
Incl_1 = ../../lib3.2/src/aide
Incls = -I$(Incl_1)
FFLAGS = -C -u $(OptDbg) $(Incls)
# Compiler name
F77 = f77
# this description file uses the Bourne shell
SHELL = /bin/sh
#*******************************************************************
#***** You should not need to modify anything below this line. *****
#*******************************************************************
program = hspf_g
Objects = hspfbat.o hspsta.o
Share = pmesfl.inc
#LibDir = ../../lib3.0/lib
#Libs = $(LibDir)/hspf11_1lib.a $(LibDir)/hspdsslib.a \
# $(LibDir)/hspf11_1lib.a $(LibDir)/wdmlib.a \
# $(LibDir)/adwdmlib.a $(LibDir)/utillib.a \
# $(LibDir)/heclib.a
LibDir = ../../lib3.2/lib
Libs = $(LibDir)/ghspflib.a $(LibDir)/hspnodsslib.a \
$(LibDir)/ghspflib.a $(LibDir)/wdmlib.a \
$(LibDir)/adwdmlib.a $(LibDir)/utillib.a
#adwdmlib.a aidelib.a annlib.a awstatlib.a graphlib.a hspflib.a hspnodsslib.a newaqtlib.a statslib.a utillib.a waidelib.a wdmlib.a
BINDIR = ../bin
binary = ../bin
binMake = $(binary)/$(program)
binInst = $(BINDIR)/$(program)
# Rules
all: includes $(binary) $(binMake) install
@echo "\n"Done making all, files are now up to date."\n"
# program dependencies
$(binMake): $(Objects) $(Libs)
$(F77) $(Objects) $(Libs) -o $@
$(binary):
@if [ ! -d $(binary) ] ; then \
mkdir $(binary) ; \
echo Created directory $(binary) ; \
fi
install:
# Create directory for binary file, if necessary
@if [ ! -d $(BINDIR) ] ; then \
mkdir $(BINDIR) ; \
echo Created directory $(BINDIR) ; \
fi
# Link executable to BINDIR if installing elsewhere
@if [ ! -s $(binMake) ] ; then \
echo program $(binMake) does not exist, ; \
echo use one of the following commands to generate it:; \
echo " make" ; echo " make all" ; \
else \
if [ $(BINDIR) != $(binary) ] ; then \
rm -f $(binInst) ; \
cd ../..; ln -s `pwd`/bin/$(program) $(binInst); \
chmod 644 $(binInst) ; \
echo "\n"Program $(binInst) has been updated.; \
fi ; \
fi
clean:
@if [ $(BINDIR) != $(binary) ] ; then rm -f $(binInst) ; fi
rm -f *.o $(binMake)
@echo Removed files generated by make."\n"
includes:
# @for inc in $(Share) ; do \
# if [ -f $$inc ] ; then \
# echo ; \
# echo "NOTICE--duplicate $$inc appended to ERROR.inc" ; \
# echo ; \
# cat $$inc >> ERROR.inc ; \
# rm $$inc ; \
# fi ; \
# done
# Define object file dependencies:
hspfbat.o: fhsmes.inc versn.inc $(Incl_1)/pmesfl.inc
# end of make