-
Notifications
You must be signed in to change notification settings - Fork 0
/
test9.make
196 lines (149 loc) · 2.89 KB
/
test9.make
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
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
PROJECT=int2 # for historical reasons we always like to
# call the executable int2, but you could set it to
# something more descriptive
###HOST=windows
HOST=linux
###HOST=macosx
ifeq ($(HOST),linux)
OBJSUF=o
MODSUF=mod
FC=f77 -c
FFLAGS=-fast
FLINK=f77 -o $(PROJECT)
else
ifeq ($(HOST),macosx)
OBJSUF=o
MODSUF=mod
FC=gfortran -c
FFLAGS=-O2
FLINK=gfortran -o $(PROJECT)
else
ifeq ($(HOST),linux-gfortran)
# buggy compiler, do not use -O2
OBJSUF=o
MODSUF=mod
FC=gfortran -c
FFLAGS=-O1
FLINK=gfortran -o $(PROJECT)
else
ifeq ($(HOST),linux-gfortran-openmp)
# buggy compiler, proceed anyway, use gfortran > 4.4.0
OBJSUF=o
MODSUF=mod
FC=gfortran -c
FFLAGS=-O3 --openmp
FLINK=gfortran -o $(PROJECT) --openmp
### export OMP_NUM_THREADS=4
### export OMP_STACKSIZE=1024M
else
ifeq ($(HOST),linux-intel-openmp)
OBJSUF=o
MODSUF=mod
FC=ief77 -c
FFLAGS= -xT -O3 -ip -openmp
FLINK=ief77 -o $(PROJECT) -xT -O3 -ip -openmp -static
WITH_SECOND=1
else
ifeq ($(HOST),linux-intel)
OBJSUF=o
MODSUF=mod
FC=ief77 -c
FFLAGS=-xT -O3 -ip
FLINK=ief77 -o $(PROJECT) -xT -O3 -ip
WITH_SECOND=1
else
ifeq ($(HOST),linux-intel-profile)
OBJSUF=o
MODSUF=mod
FC=ief77 -c
FFLAGS=-xT -O3 -ip -p
FLINK=ief77 -o $(PROJECT) -xT -O3 -ip -p
WITH_SECOND=1
else
ifeq ($(HOST),linux-intel64)
OBJSUF=o
MODSUF=mod
FC=ief77 -c
FFLAGS=-xT -O3 -ip -mcmodel medium -i-dynamic
FLINK=ief77 -o $(PROJECT) -xT -O3 -ip -mcmodel medium -i-dynamic
###export LD_LIBRARY_PATH=/opt/intel/fce/10.1.008/lib
WITH_SECOND=1
else
ifeq ($(HOST),linux-lahey64)
OBJSUF=o
MODSUF=mod
FC=lf77_x64 -c
FFLAGS=-fast --model medium
FLINK=lf77_x64 -o $(PROJECT) -fast --model medium /opt/lf6481/lib64/libelf.so.0
###FLINK=lf77_x64 -o $(PROJECT) -fast --model medium
WITH_SECOND=1
else
ifeq ($(HOST),linux-fort77)
OBJSUF=o
MODSUF=mod
FC=fort77 -c
FFLAGS=-fast
FLINK=fort77 -o $(PROJECT) -static -g
WITH_SECOND=1
else
ifeq ($(HOST),linux-profile)
OBJSUF=o
MODSUF=mod
FC=fort77-i386-m32 -c
FFLAGS=-fast -profile -pg
FLINK=fort77-i386-m32 -o $(PROJECT) -static -pg -g
WITH_SECOND=1
else
OBJSUF=obj
MODSUF=mod
FC=lf95 -c
FFLAGS=-O1
FLINK=lf95 -out $(PROJECT)
endif
endif
endif
endif
endif
endif
endif
endif
endif
endif
endif
.PHONY: $(PROJECT) clean list
.f.$(OBJSUF):
$(FC) $(FFLAGS) $<
.f.$(MODSUF):
$(FC) $(FFLAGS) $<
.SUFFIXES: $(MODSUF) .$(OBJSUF) .f .c
# SOURCE FILE LIST
#
vpath %.f .:../lib:../geo
FMODS =
FSRCS = test9.f chunkmatc.f inter2dn.f hank103.f \
cadavect.f hqsuppquad.f \
cgmres6-rel.f \
cqrsolve.f \
legeexps.f prini.f
ifeq ($(WITH_SECOND),1)
FSRCS += second-r8.f
endif
#
# object files list
MODS = $(FMODS:.f=.$(MODSUF))
OBJS = $(FMODS:.f=.$(OBJSUF)) $(FSRCS:.f=.$(OBJSUF))
#
$(PROJECT): $(MODS) $(OBJS)
rm -f $(PROJECT)
$(FLINK) $(OBJS)
./$(PROJECT)
#
clean:
rm -f $(OBJS)
#
list: $(FSRCS)
echo $^
#
pack: $(FSRCS)
cat $^ > _tmp_.pack.f
#