forked from MethodicalAcceleratorDesign/MAD-X
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile_lnx
241 lines (190 loc) · 8.48 KB
/
Makefile_lnx
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
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
# |
# o---------------------------------------------------------------------o
# |
# | MAD makefile - post-makefile linux cutomization
# |
# o---------------------------------------------------------------------o
# |
# | Methodical Accelerator Design
# |
# | Copyright (c) 2011+ CERN, [email protected]
# |
# | For more information, see http://cern.ch/mad
# |
# o---------------------------------------------------------------------o
# |
# | $Id$
# |
#
# all
#
all-linux-gnu: all-linux64-gnu all-linux32-gnu
all-linux-llvm: all-linux64-llvm all-linux32-llvm
all-linux-intel: all-linux64-intel all-linux32-intel
all-linux32-gnu: madx-linux32-gnu numdiff-linux32-gnu # libptc-linux32-gnu libmadx-linux32-gnu
all-linux64-gnu: madx-linux64-gnu numdiff-linux64-gnu # libptc-linux64-gnu libmadx-linux64-gnu
all-linux32-llvm: madx-linux32-llvm numdiff-linux32-llvm # libmadx-linux32-llvm libptc-linux32-llvm
all-linux64-llvm: madx-linux64-llvm numdiff-linux64-llvm # libmadx-linux64-llvm libptc-linux64-llvm
all-linux32-intel: madx-linux32-intel numdiff-linux32-intel # libmadx-linux32-intel libptc-linux32-intel
all-linux64-intel: madx-linux64-intel numdiff-linux64-intel # libmadx-linux64-intel libptc-linux64-intel
#
# cleanbuild platform specific
#
cleanarch:
$E "** Cleaning binaries and libraries"
$_ $(RM) $(wildcard madx32 madx64 numdiff32 numdiff64 libmadx32* libmadx64* libptc32* libptc64*)
$_ $(RM) $(wildcard madx-linux* libmadx-linux* libptc-linux* numdiff-linux* libs/gc/libgc*.a)
#
# madx
#
madx-linux-gnu: madx-linux64-gnu madx-linux32-gnu
madx-linux-llvm: madx-linux64-llvm madx-linux32-llvm
madx-linux-intel: madx-linux64-intel madx-linux32-intel
madx-linux-lahey: madx-linux64-lahey madx-linux32-lahey
madx-linux-nagfor: madx-linux64-nagfor madx-linux32-nagfor
.PHONY: madx-linux32-gnu madx-linux64-gnu
.PHONY: madx-linux32-llvm madx-linux64-llvm
.PHONY: madx-linux32-intel madx-linux64-intel
.PHONY: madx-linux32-lahey madx-linux64-lahey
.PHONY: madx-linux32-nagfor madx-linux64-nagfor
LINUX_STATIC := $(if $(call eq,$(PLUGIN),yes),no,yes)
madx-linux%: MAKE_ARGS = PRJNAME=$@ DESTDIR=$(DESTDIR) ONLINE=yes STATIC=$(LINUX_STATIC) USEGC=yes APPENDLD=yes X11=yes
madx-linux%: MAKE_OPTS = -j9 $(MAKEARGS)
madx-linux%: MAKE_LINK = ln -sf $(DESTDIR)$@ && ln -sf $@
madx-linux32-gnu: libs/gc/libgc-linux32-gnu.a
$E "*** Building $@"
$_ $(MAKE) $(MAKE_ARGS) $(MAKE_OPTS) ARCH=32 COMP=gnu && $(MAKE_LINK) madx32
madx-linux64-gnu: libs/gc/libgc-linux64-gnu.a
$E "*** Building $@"
$_ $(MAKE) $(MAKE_ARGS) $(MAKE_OPTS) ARCH=64 COMP=gnu && $(MAKE_LINK) madx64
madx-linux32-intel: libs/gc/libgc-linux32-intel.a
$E "*** Building $@"
$_ $(MAKE) $(MAKE_ARGS) $(MAKE_OPTS) ARCH=32 COMP=intel && $(MAKE_LINK) madx32
madx-linux64-intel: libs/gc/libgc-linux64-intel.a
$E "*** Building $@"
$_ $(MAKE) $(MAKE_ARGS) $(MAKE_OPTS) ARCH=64 COMP=intel && $(MAKE_LINK) madx64
madx-linux32-llvm: libs/gc/libgc-linux32-llvm.a
$E "*** Building $@"
$_ $(MAKE) $(MAKE_ARGS) $(MAKE_OPTS) ARCH=32 COMP=llvm && $(MAKE_LINK) madx32
madx-linux64-llvm: libs/gc/libgc-linux64-llvm.a
$E "*** Building $@"
$_ $(MAKE) $(MAKE_ARGS) $(MAKE_OPTS) ARCH=64 COMP=llvm && $(MAKE_LINK) madx64
madx-linux32-nagfor: libs/gc/libgc-linux32-gnu.a
$E "*** Building $@"
$_ $(MAKE) $(MAKE_ARGS) $(MAKE_OPTS) ARCH=32 FC=nagfor && $(MAKE_LINK) madx32
madx-linux64-nagfor: libs/gc/libgc-linux64-gnu.a
$E "*** Building $@"
$_ $(MAKE) $(MAKE_ARGS) $(MAKE_OPTS) ARCH=64 FC=nagfor && $(MAKE_LINK) madx64
madx-linux32-lahey: libs/gc/libgc-linux32-gnu.a
$E "*** Building $@"
$_ $(MAKE) $(MAKE_ARGS) $(MAKE_OPTS) ARCH=32 FC=lf95 && $(MAKE_LINK) madx32
madx-linux64-lahey: libs/gc/libgc-linux64-gnu.a
$E "*** Building $@"
$_ $(MAKE) $(MAKE_ARGS) $(MAKE_OPTS) ARCH=64 FC=lf95 && $(MAKE_LINK) madx64
#
# libgc
#
libs/gc/libgc-linux%: MAKE_OPTS = -j9 --no-print-directory -C libs/gc
libs/gc/libgc-linux32-gnu.a:
$E "*** Building $@"
$_ $(MAKE) $(MAKE_OPTS) libgc-linux32-gnu;
libs/gc/libgc-linux64-gnu.a:
$E "*** Building $@"
$_ $(MAKE) $(MAKE_OPTS) libgc-linux64-gnu;
libs/gc/libgc-linux32-intel.a:
$E "*** Building $@"
$_ $(MAKE) $(MAKE_OPTS) libgc-linux32-intel;
libs/gc/libgc-linux64-intel.a:
$E "*** Building $@"
$_ $(MAKE) $(MAKE_OPTS) libgc-linux64-intel;
libs/gc/libgc-linux32-llvm.a:
$E "*** Building $@"
$_ $(MAKE) $(MAKE_OPTS) libgc-linux32-llvm;
libs/gc/libgc-linux64-llvm.a:
$E "*** Building $@"
$_ $(MAKE) $(MAKE_OPTS) libgc-linux64-llvm;
#
# libmadx
#
libmadx-linux-gnu: libmadx-linux64-gnu libmadx-linux32-gnu
libmadx-linux-llvm: libmadx-linux64-llvm libmadx-linux32-llvm
libmadx-linux-intel: libmadx-linux64-intel libmadx-linux32-intel
libmadx-linux%: DESTDIR := $(DESTDIR)libs/madx/
libmadx-linux%: MAKE_ARGS = PRJNAME=$@ DESTDIR=../../$(DESTDIR) ONLINE=no STATIC=yes USEGC=yes APPENDLD=yes
libmadx-linux%: MAKE_OPTS = -j9 --no-print-directory -C libs/madx $(MAKEARGS)
libmadx-linux%: MAKE_LINK = ln -sf $(DESTDIR)[email protected] && ln -sf $(DESTDIR)[email protected]
libmadx-linux32-gnu:
$E "*** Building $@"
$_ $(MAKE) $(MAKE_ARGS) $(MAKE_OPTS) ARCH=32 COMP=gnu && $(MAKE_LINK)
libmadx-linux64-gnu:
$E "*** Building $@" # STATIC=no due to missing -fPIC in the runtime library of gfortran 64 bit
$_ $(MAKE) $(MAKE_ARGS) $(MAKE_OPTS) ARCH=64 COMP=gnu STATIC=no && $(MAKE_LINK)
libmadx-linux32-intel:
$E "*** Building $@"
$_ $(MAKE) $(MAKE_ARGS) $(MAKE_OPTS) ARCH=32 COMP=intel && $(MAKE_LINK)
libmadx-linux64-intel:
$E "*** Building $@"
$_ $(MAKE) $(MAKE_ARGS) $(MAKE_OPTS) ARCH=64 COMP=intel && $(MAKE_LINK)
libmadx-linux32-llvm:
$E "*** Building $@"
$_ $(MAKE) $(MAKE_ARGS) $(MAKE_OPTS) ARCH=32 COMP=llvm && $(MAKE_LINK)
libmadx-linux64-llvm:
$E "*** Building $@" # STATIC=no due to missing -fPIC in the runtime library of gfortran 64 bit
$_ $(MAKE) $(MAKE_ARGS) $(MAKE_OPTS) ARCH=64 COMP=llvm STATIC=no && $(MAKE_LINK)
#
# libptc
#
libptc-linux-gnu: libptc-linux64-gnu libptc-linux32-gnu
libptc-linux-llvm: libptc-linux64-llvm libptc-linux32-llvm
libptc-linux-intel: libptc-linux64-intel libptc-linux32-intel
libptc-linux%: DESTDIR := $(DESTDIR)libs/ptc/
libptc-linux%: MAKE_ARGS = PRJNAME=$@ DESTDIR=../../$(DESTDIR) STATIC=yes APPENDLD=yes
libptc-linux%: MAKE_OPTS = -j9 --no-print-directory -C libs/ptc $(MAKEARGS)
libptc-linux%: MAKE_LINK = ln -sf $(DESTDIR)[email protected] && ln -sf $(DESTDIR)[email protected]
libptc-linux32-gnu:
$E "*** Building $@"
$_ $(MAKE) $(MAKE_ARGS) $(MAKE_OPTS) ARCH=32 COMP=gnu && $(MAKE_LINK)
libptc-linux64-gnu:
$E "*** Building $@" # STATIC=no due to missing -fPIC in the runtime library of gfortran 64 bit
$_ $(MAKE) $(MAKE_ARGS) $(MAKE_OPTS) ARCH=64 COMP=gnu STATIC=no && $(MAKE_LINK)
libptc-linux32-intel:
$E "*** Building $@"
$_ $(MAKE) $(MAKE_ARGS) $(MAKE_OPTS) ARCH=32 COMP=intel && $(MAKE_LINK)
libptc-linux64-intel:
$E "*** Building $@"
$_ $(MAKE) $(MAKE_ARGS) $(MAKE_OPTS) ARCH=64 COMP=intel && $(MAKE_LINK)
libptc-linux32-llvm:
$E "*** Building $@"
$_ $(MAKE) $(MAKE_ARGS) $(MAKE_OPTS) ARCH=32 COMP=llvm && $(MAKE_LINK)
libptc-linux64-llvm:
$E "*** Building $@" # STATIC=no due to missing -fPIC in the runtime library of gfortran 64 bit
$_ $(MAKE) $(MAKE_ARGS) $(MAKE_OPTS) ARCH=64 COMP=llvm STATIC=no && $(MAKE_LINK)
#
# numdiff
#
numdiff-linux-gnu: numdiff-linux64-gnu numdiff-linux32-gnu
numdiff-linux-llvm: numdiff-linux64-llvm numdiff-linux32-llvm
numdiff-linux-intel: numdiff-linux64-intel numdiff-linux32-intel
numdiff-linux%: DESTDIR := $(DESTDIR)tools/numdiff/
numdiff-linux%: MAKE_ARGS = PRJNAME=$@ DESTDIR=../../$(DESTDIR) STATIC=yes APPENDLD=yes
numdiff-linux%: MAKE_OPTS = -j9 --no-print-directory -C tools/numdiff $(MAKEARGS)
numdiff-linux%: MAKE_LINK = ln -sf $(DESTDIR)$@ && ln -sf $@
numdiff-linux32-gnu:
$E "*** Building $@"
$_ $(MAKE) $(MAKE_ARGS) $(MAKE_OPTS) ARCH=32 COMP=gnu && $(MAKE_LINK) numdiff32
numdiff-linux64-gnu:
$E "*** Building $@"
$_ $(MAKE) $(MAKE_ARGS) $(MAKE_OPTS) ARCH=64 COMP=gnu && $(MAKE_LINK) numdiff64
numdiff-linux32-intel:
$E "*** Building $@"
$_ $(MAKE) $(MAKE_ARGS) $(MAKE_OPTS) ARCH=32 COMP=intel && $(MAKE_LINK) numdiff32
numdiff-linux64-intel:
$E "*** Building $@"
$_ $(MAKE) $(MAKE_ARGS) $(MAKE_OPTS) ARCH=64 COMP=intel && $(MAKE_LINK) numdiff64
numdiff-linux32-llvm:
$E "*** Building $@"
$_ $(MAKE) $(MAKE_ARGS) $(MAKE_OPTS) ARCH=32 COMP=llvm && $(MAKE_LINK) numdiff32
numdiff-linux64-llvm:
$E "*** Building $@"
$_ $(MAKE) $(MAKE_ARGS) $(MAKE_OPTS) ARCH=64 COMP=llvm && $(MAKE_LINK) numdiff64
# end of makefile