forked from MethodicalAcceleratorDesign/MAD-X
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile_mac
229 lines (180 loc) · 7.51 KB
/
Makefile_mac
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
# |
# o---------------------------------------------------------------------o
# |
# | MAD makefile - post-makefile MacOSX customization
# |
# o---------------------------------------------------------------------o
# |
# | Methodical Accelerator Design
# |
# | Copyright (c) 2011+ CERN, mad@cern.ch
# |
# | For more information, see http://cern.ch/mad
# |
# o---------------------------------------------------------------------o
# |
# | $Id$
# |
#
# all
#
all-macosx-gnu: all-macosx64-gnu all-macosx32-gnu
all-macosx-llvm: all-macosx64-llvm all-macosx32-llvm
all-macosx-intel: all-macosx64-intel all-macosx32-intel
all-macosx32-gnu: madx-macosx32-gnu numdiff-macosx32-gnu # libmadx-macosx32-gnu libptc-macosx32-gnu
all-macosx64-gnu: madx-macosx64-gnu numdiff-macosx64-gnu # libmadx-macosx64-gnu libptc-macosx64-gnu
all-macosx32-llvm: madx-macosx32-llvm numdiff-macosx32-llvm # libmadx-macosx32-llvm libptc-macosx32-llvm
all-macosx64-llvm: madx-macosx64-llvm numdiff-macosx64-llvm # libmadx-macosx64-llvm libptc-macosx64-llvm
all-macosx32-intel: madx-macosx32-intel numdiff-macosx32-intel # libmadx-macosx32-intel libptc-macosx32-intel
all-macosx64-intel: madx-macosx64-intel numdiff-macosx64-intel # libmadx-macosx64-intel libptc-macosx64-intel
#
# minimum backward compatibility (may trig warnings with macport libs > 10.8)
#
# ifeq ($(MACOSX_DEPLOYMENT_TARGET),)
# export MACOSX_DEPLOYMENT_TARGET=10.8
# endif
#
# cleanbuild platform specific
#
cleanarch:
$E "** Cleaning binaries and libraries"
$_ $(RM) $(wildcard madx32 madx64 numdiff32 numdiff64 libmadx32* libmadx64* libptc32* libptc64*)
$_ $(RM) $(wildcard madx-macosx* libmadx-macosx* libptc-macosx* numdiff-macosx* libs/gc/libgc*.a)
#
# madx
#
madx-macosx-gnu: madx-macosx64-gnu madx-macosx32-gnu
madx-macosx-llvm: madx-macosx64-llvm madx-macosx32-llvm
madx-macosx-intel: madx-macosx64-intel madx-macosx32-intel
.PHONY: madx-macosx32-gnu madx-macosx64-gnu
.PHONY: madx-macosx32-llvm madx-macosx64-llvm
.PHONY: madx-macosx32-intel madx-macosx64-intel
MACOSX_STATIC := $(if $(call eq,$(PLUGIN),yes),no,yes)
madx-macosx%: MAKE_ARGS = PRJNAME=$@ DESTDIR=$(DESTDIR) ONLINE=no STATIC=$(MACOSX_STATIC) USEGC=yes APPENDLD=yes X11=yes
madx-macosx%: MAKE_OPTS = -j9 $(MAKEARGS)
madx-macosx%: MAKE_LINK = ln -sf $(DESTDIR)$@ && ln -sf $@
madx-macosx32-gnu: libs/gc/libgc-macosx32-gnu.a
$E "*** Building $@"
$_ $(MAKE) $(MAKE_ARGS) $(MAKE_OPTS) ARCH=32 COMP=gnu && $(MAKE_LINK) madx32
madx-macosx64-gnu: libs/gc/libgc-macosx64-gnu.a
$E "*** Building $@"
$_ $(MAKE) $(MAKE_ARGS) $(MAKE_OPTS) ARCH=64 COMP=gnu && $(MAKE_LINK) madx64
madx-macosx32-intel: libs/gc/libgc-macosx32-intel.a
$E "*** Building $@"
$_ $(MAKE) $(MAKE_ARGS) $(MAKE_OPTS) ARCH=32 COMP=intel && $(MAKE_LINK) madx32
madx-macosx64-intel: libs/gc/libgc-macosx64-intel.a
$E "*** Building $@"
$_ $(MAKE) $(MAKE_ARGS) $(MAKE_OPTS) ARCH=64 COMP=intel && $(MAKE_LINK) madx64
madx-macosx32-llvm: libs/gc/libgc-macosx32-llvm.a
$E "*** Building $@"
$_ $(MAKE) $(MAKE_ARGS) $(MAKE_OPTS) ARCH=32 COMP=llvm && $(MAKE_LINK) madx32
madx-macosx64-llvm: libs/gc/libgc-macosx64-llvm.a
$E "*** Building $@"
$_ $(MAKE) $(MAKE_ARGS) $(MAKE_OPTS) ARCH=64 COMP=llvm && $(MAKE_LINK) madx64
#
# libgc
#
libs/gc/libgc-macosx%: MAKE_OPTS = -j9 --no-print-directory -C libs/gc
libs/gc/libgc-macosx32-gnu.a:
$E "*** Building $@"
$_ $(MAKE) $(MAKE_OPTS) libgc-macosx32-gnu
libs/gc/libgc-macosx64-gnu.a:
$E "*** Building $@"
$_ $(MAKE) $(MAKE_OPTS) libgc-macosx64-gnu
libs/gc/libgc-macosx32-intel.a:
$E "*** Building $@"
$_ $(MAKE) $(MAKE_OPTS) libgc-macosx32-intel
libs/gc/libgc-macosx64-intel.a:
$E "*** Building $@"
$_ $(MAKE) $(MAKE_OPTS) libgc-macosx64-intel
libs/gc/libgc-macosx32-llvm.a:
$E "*** Building $@"
$_ $(MAKE) $(MAKE_OPTS) libgc-macosx32-llvm
libs/gc/libgc-macosx64-llvm.a:
$E "*** Building $@"
$_ $(MAKE) $(MAKE_OPTS) libgc-macosx64-llvm
#
# libmadx
#
libmadx-macosx-gnu: libmadx-macosx64-gnu libmadx-macosx32-gnu
libmadx-macosx-llvm: libmadx-macosx64-llvm libmadx-macosx32-llvm
libmadx-macosx-intel: libmadx-macosx64-intel libmadx-macosx32-intel
libmadx-macosx%: DESTDIR := $(DESTDIR)libs/madx/
libmadx-macosx%: MAKE_ARGS = PRJNAME=$@ DESTDIR=../../$(DESTDIR) ONLINE=no STATIC=no USEGC=yes APPENDLD=yes
libmadx-macosx%: MAKE_OPTS = -j9 --no-print-directory -C libs/madx $(MAKEARGS)
libmadx-macosx%: MAKE_LINK = ln -sf $(DESTDIR)$@.a && ln -sf $(DESTDIR)$@.dylib
libmadx-macosx32-gnu:
$E "*** Building $@"
$_ $(MAKE) $(MAKE_ARGS) $(MAKE_OPTS) ARCH=32 COMP=gnu && $(MAKE_LINK)
libmadx-macosx64-gnu:
$E "*** Building $@"
$_ $(MAKE) $(MAKE_ARGS) $(MAKE_OPTS) ARCH=64 COMP=gnu && $(MAKE_LINK)
libmadx-macosx32-intel:
$E "*** Building $@"
$_ $(MAKE) $(MAKE_ARGS) $(MAKE_OPTS) ARCH=32 COMP=intel && $(MAKE_LINK)
libmadx-macosx64-intel:
$E "*** Building $@"
$_ $(MAKE) $(MAKE_ARGS) $(MAKE_OPTS) ARCH=64 COMP=intel && $(MAKE_LINK)
libmadx-macosx32-llvm:
$E "*** Building $@"
$_ $(MAKE) $(MAKE_ARGS) $(MAKE_OPTS) ARCH=32 COMP=llvm && $(MAKE_LINK)
libmadx-macosx64-llvm:
$E "*** Building $@"
$_ $(MAKE) $(MAKE_ARGS) $(MAKE_OPTS) ARCH=64 COMP=llvm && $(MAKE_LINK)
#
# libptc
#
libptc-macosx-gnu: libptc-macosx64-gnu libptc-macosx32-gnu
libptc-macosx-llvm: libptc-macosx64-llvm libptc-macosx32-llvm
libptc-macosx-intel: libptc-macosx64-intel libptc-macosx32-intel
libptc-macosx%: DESTDIR := $(DESTDIR)libs/ptc/
libptc-macosx%: MAKE_ARGS = PRJNAME=$@ DESTDIR=../../$(DESTDIR) STATIC=no APPENDLD=yes
libptc-macosx%: MAKE_OPTS = -j9 --no-print-directory -C libs/ptc $(MAKEARGS)
libptc-macosx%: MAKE_LINK = ln -sf $(DESTDIR)$@.a && ln -sf $(DESTDIR)$@.dylib
libptc-macosx32-gnu:
$E "*** Building $@"
$_ $(MAKE) $(MAKE_ARGS) $(MAKE_OPTS) ARCH=32 COMP=gnu && $(MAKE_LINK)
libptc-macosx64-gnu:
$E "*** Building $@"
$_ $(MAKE) $(MAKE_ARGS) $(MAKE_OPTS) ARCH=64 COMP=gnu && $(MAKE_LINK)
libptc-macosx32-intel:
$E "*** Building $@"
$_ $(MAKE) $(MAKE_ARGS) $(MAKE_OPTS) ARCH=32 COMP=intel && $(MAKE_LINK)
libptc-macosx64-intel:
$E "*** Building $@"
$_ $(MAKE) $(MAKE_ARGS) $(MAKE_OPTS) ARCH=64 COMP=intel && $(MAKE_LINK)
libptc-macosx32-llvm:
$E "*** Building $@"
$_ $(MAKE) $(MAKE_ARGS) $(MAKE_OPTS) ARCH=32 COMP=llvm && $(MAKE_LINK)
libptc-macosx64-llvm:
$E "*** Building $@"
$_ $(MAKE) $(MAKE_ARGS) $(MAKE_OPTS) ARCH=64 COMP=llvm && $(MAKE_LINK)
#
# numdiff
#
numdiff-macosx-gnu: numdiff-macosx64-gnu numdiff-macosx32-gnu
numdiff-macosx-llvm: numdiff-macosx64-llvm numdiff-macosx32-llvm
numdiff-macosx-intel: numdiff-macosx64-intel numdiff-macosx32-intel
numdiff-macosx%: DESTDIR := $(DESTDIR)tools/numdiff/
numdiff-macosx%: MAKE_ARGS = PRJNAME=$@ DESTDIR=../../$(DESTDIR) STATIC=yes APPENDLD=yes
numdiff-macosx%: MAKE_OPTS = -j9 --no-print-directory -C tools/numdiff $(MAKEARGS)
numdiff-macosx%: MAKE_LINK = ln -sf $(DESTDIR)$@ && ln -sf $@
numdiff-macosx32-gnu:
$E "*** Building $@"
$_ $(MAKE) $(MAKE_ARGS) $(MAKE_OPTS) ARCH=32 COMP=gnu && $(MAKE_LINK) numdiff32
numdiff-macosx64-gnu:
$E "*** Building $@"
$_ $(MAKE) $(MAKE_ARGS) $(MAKE_OPTS) ARCH=64 COMP=gnu && $(MAKE_LINK) numdiff64
numdiff-macosx32-intel:
$E "*** Building $@"
$_ $(MAKE) $(MAKE_ARGS) $(MAKE_OPTS) ARCH=32 COMP=intel && $(MAKE_LINK) numdiff32
numdiff-macosx64-intel:
$E "*** Building $@"
$_ $(MAKE) $(MAKE_ARGS) $(MAKE_OPTS) ARCH=64 COMP=intel && $(MAKE_LINK) numdiff64
numdiff-macosx32-llvm:
$E "*** Building $@"
$_ $(MAKE) $(MAKE_ARGS) $(MAKE_OPTS) ARCH=32 COMP=llvm && $(MAKE_LINK) numdiff32
numdiff-macosx64-llvm:
$E "*** Building $@"
$_ $(MAKE) $(MAKE_ARGS) $(MAKE_OPTS) ARCH=64 COMP=llvm && $(MAKE_LINK) numdiff64
# end of makefile