forked from RTcmix/RTcmix
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmakefile.conf.in
359 lines (321 loc) · 10.2 KB
/
makefile.conf.in
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
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
###############################################################
# makefile.conf
#
# There should be no need for most people, other than code
# maintainers, to change anything in this file. To build
# RTcmix, use the configure script instead:
#
# $ ./configure [--with-alsa] [--with-perl] [--with-python]
#
# See INSTALL for details. After using configure, you can
# override what it does by editing site.conf, if you want.
###############################################################
# The name of the RTcmix directory
CMIXDIR = @CMIXDIR@
# This file is generated by the configure script.
include $(CMIXDIR)/defs.conf
# The dir that will contain the instrument dynamic shared objects
LIBDESTDIR = $(CMIXDIR)/shlib
# This file contains site-specific settings. Anything that's
# uncommented in this file will override the same definition
# made inside defs.conf by the configure script. The same goes
# for any other symbol defined above (such as LIBDESTDIR).
include $(CMIXDIR)/site.conf
# The path to this file
MAKEFILE_CONF = $(CMIXDIR)/makefile.conf
LIBDIR = $(CMIXDIR)/lib
DESTDIR = $(CMIXDIR)/bin
BINDIR = $(DESTDIR)
INCLUDEDIR = $(CMIXDIR)/include
SRCDIR = $(CMIXDIR)/src
AUDIODIR = $(SRCDIR)/audio
CONFDIR = $(SRCDIR)/conf
PARSERDIR = $(SRCDIR)/parser
MINCDIR = $(PARSERDIR)/minc
PERLDIR = $(PARSERDIR)/perl
# For temporary use in linking MIX instrument in
MIXDIR = insts/base/MIX
MINCLIB = $(MINCDIR)/libminc.a
SNDLIB = $(SRCDIR)/sndlib/sndlib.a
AUDIOLIB = $(AUDIODIR)/librtaudio.a
# Compile and link time flags
# -- Linux ----------------------------------------------------
ifeq ($(ARCH),LINUX)
ARCHFLAGS = -DLINUX $(ARCH_BITFLAGS)
ARCH_RTLDFLAGS = -Wl,-rpath $(LIBDIR)
ifeq ($(BUILDTYPE), STANDALONE)
ARCHFLAGS += -DSTANDALONE
RTLIBTYPE = DYNAMIC
endif
ifndef AUDIODRIVER
AUDIODRIVER=OSS
endif
CC = gcc
CXX = g++ -Wno-deprecated
LD = ld
MAKE = make
INSTALL = cp -f
RANLIB = touch
SHELL = /bin/sh
SHLIB = rtcmix
SHLIB_SUFFIX = so
endif
# -- Mac OS X -------------------------------------------------
ifeq ($(ARCH),MACOSX)
# DAS: create better macro
ARCHFLAGS = -fno-common -DMACOSX
ARCH_RTLDFLAGS = -dylib_file /usr/lib/$(RTLIB):$(LIBRTCMIX)
CC = cc
CXX = c++ -Wno-deprecated
LD = ld
MAKE = make
INSTALL = cp -f
RANLIB = ranlib
SHELL = /bin/sh
# Optional but rare override for the maximum number of supported audio
# channels. Must be >= 8
ifdef MAXCHANS
ARCHFLAGS += -DMAXCHANS=$(MAXCHANS)
endif
# -- standalone (OSX) ----------------------------------------
ifeq ($(BUILDTYPE), STANDALONE)
ARCHFLAGS += $(ARCH_BITFLAGS) -DSTANDALONE
ARCH_SYS_LDFLAGS = -framework CoreFoundation
ifeq ($(USE_OSX_DISPATCH), TRUE)
ARCHFLAGS += -DUSE_OSX_DISPATCH
endif
ARCH_RTLDFLAGS += -framework AudioUnit
SHLIB = rtcmix
SHLIB_SUFFIX = dylib
AUDIODRIVER=APPLE
CMIX_FLAGS += -DAPPLEAUDIO
endif
# -- OSX embedded ----------------------------------------
ifeq ($(BUILDTYPE), OSXEMBEDDED)
ARCHFLAGS += $(ARCH_BITFLAGS) -DEMBEDDED
ARCH_SYS_LDFLAGS = -framework CoreFoundation -framework AudioToolbox
ifeq ($(USE_OSX_DISPATCH), TRUE)
ARCHFLAGS += -DUSE_OSX_DISPATCH
endif
ARCH_RTLDFLAGS += -framework AudioUnit
AUDIODRIVER=EMBEDDEDAUDIO
CMIX_FLAGS += -DEMBEDDEDAUDIO
SHLIB = rtcmix_embedded
# This is overridable in site.conf
ifndef RTLIBTYPE
RTLIBTYPE = DYNAMIC
endif
ifeq ($(RTLIBTYPE), DYNAMIC)
SHLIB_SUFFIX = dylib
RTLIB_LDFLAGS = $(DYNAMIC_LDFLAGS)
else
ARCH_RTLDFLAGS =
SHLIB_SUFFIX = a
RTLIB_LDFLAGS =
endif
RTLIB_INSTALL_DIR = $(LIBDIR)
endif
# -- MaxMSP -------------------------------------------------
ifeq ($(BUILDTYPE), MAXMSP)
ARCHFLAGS += $(ARCH_BITFLAGS) -DEMBEDDED -DMAXMSP $(MAX_INCLUDES)
ifeq ($(USE_OSX_DISPATCH), TRUE)
ARCHFLAGS += -DUSE_OSX_DISPATCH
endif
# Optional but rare override for the maximum number of supported audio
# channels. Must be >= 8
ifdef MAXCHANS
ARCHFLAGS += -DMAXCHANS=$(MAXCHANS)
endif
ARCHFLAGS += -isysroot `xcrun --show-sdk-path`
CC = `xcrun -f cc`
CXX = `xcrun -f c++` -Wno-deprecated
SHLIB = rtcmixdylib
SHLIB_SUFFIX = so
RTLIB_LDFLAGS = $(UB_CFLAGS) -Wl,-U,_cpost,-bundle,-flat_namespace
RTLIBTYPE = DYNAMIC
RTLIB_INSTALL_DIR = $(MAX_LIB_INSTALL_DIR)
AUDIODRIVER=EMBEDDEDAUDIO
CMIX_FLAGS += -DEMBEDDEDAUDIO
endif
# -- iOS ----------------------------------------------------
ifeq ($(BUILDTYPE), IOS)
# This is always true for IOS
RTLIBTYPE = STATIC
SHLIB_SUFFIX = a
# This is overridable in site.conf
ifndef AUDIODRIVER
AUDIODRIVER=APPLE
endif
ifeq ($(AUDIODRIVER), EMBEDDEDAUDIO)
CMIX_FLAGS += -DEMBEDDEDAUDIO
else
CMIX_FLAGS += -DAPPLEAUDIO
endif
ifeq ($(IPHONE_TYPE), SIMULATOR)
ARCH_BITFLAGS = -m64
ARCHFLAGS += $(ARCH_BITFLAGS) -DEMBEDDED -DIOS -DSIMULATOR -arch i386 -arch x86_64
ARCH_RTLDFLAGS = -dylib_file /usr/lib/$(RTLIB):$(LIBRTCMIX) -arch i386 -arch x86_64 -framework AudioToolbox
ifeq ($(USE_OSX_DISPATCH), TRUE)
ARCHFLAGS += -DUSE_OSX_DISPATCH
endif
IPHONE_CFLAGS = -isysroot `xcrun -sdk iphonesimulator --show-sdk-path`
CC = `xcrun -sdk iphonesimulator -f cc`
CXX = `xcrun -sdk iphonesimulator -f c++` -Wno-deprecated
SHLIB = rtcmix_iphone-SIM
endif
ifeq ($(IPHONE_TYPE), DEVICE)
ARCHFLAGS += $(ARCH_BITFLAGS) -DEMBEDDED -DIOS -DIOSDEV
ARCH_RTLDFLAGS =
ifeq ($(USE_OSX_DISPATCH), TRUE)
ARCHFLAGS += -DUSE_OSX_DISPATCH
endif
IPHONE_CFLAGS = -isysroot `xcrun -sdk iphoneos --show-sdk-path`
CC = `xcrun -sdk iphoneos -f cc` -arch armv7s -arch armv7 -arch arm64
CXX = `xcrun -sdk iphoneos -f c++` -arch armv7s -arch armv7 -arch arm64
SHLIB = rtcmix_iphone-DEV
endif
endif
endif
# -- SGI ------------------------------------------------------
ifeq ($(ARCH),SGI)
ARCHFLAGS = -DSGI $(ARCH_BITFLAGS) -DSTANDALONE
ARCH_RTLDFLAGS =
CC = cc -Xcpluscomm
CXX = CC
LD = ld
MAKE = gmake
INSTALL = cp -f
RANLIB = touch
SHELL = /bin/sh
SHLIB = rtcmix
SHLIB_SUFFIX = so
RTLIBTYPE = DYNAMIC
RTLIB_INSTALL_DIR = $(LIBDIR)
endif
# -- FreeBSD --------------------------------------------------
ifeq ($(ARCH),FREEBSD)
ARCHFLAGS = -DFREEBSD -DLINUX $(ARCH_BITFLAGS) -DSTANDALONE
ARCH_RTLDFLAGS =
CC = gcc
CXX = g++
LD = ld
MAKE = gmake
INSTALL = cp -f
RANLIB = touch
SHELL = /bin/sh
SHLIB = rtcmix
SHLIB_SUFFIX = so
RTLIBTYPE = DYNAMIC
RTLIB_INSTALL_DIR = $(LIBDIR)
endif
# -- Pd -----------------------------------------------------
ifeq ($(BUILDTYPE), PD)
ARCHFLAGS += -DEMBEDDED -DPD -I$(PD_INCLUDES)
ifeq ($(ARCH),MACOSX)
SHARED_LDFLAGS += -Wl,-U,_post
ARCHFLAGS += -arch i386 -arch x86_64
endif
ifndef RTLIBTYPE
RTLIBTYPE = DYNAMIC
endif
ifeq ($(RTLIBTYPE), DYNAMIC)
SHLIB = rtcmixdylib
SHLIB_SUFFIX = so
RTLIB_LDFLAGS = $(SHARED_LDFLAGS)
else
SHLIB = rtcmixlib
SHLIB_SUFFIX = a
RTLIB_LDFLAGS =
endif
AUDIODRIVER=EMBEDDEDAUDIO
CMIX_FLAGS += -DEMBEDDEDAUDIO
endif
ifeq ($(BUILDTYPE), STANDALONE)
RTLIB_LDFLAGS = $(DYNAMIC_LDFLAGS)
RTLIBTYPE = DYNAMIC
RTLIB_INSTALL_DIR = $(LIBDIR)
ifeq ($(NPLAY_SUPPORT), TRUE)
CMIX_FLAGS += -DNETAUDIO
endif
ifeq ($(JACK_SUPPORT), TRUE)
CMIX_FLAGS += -DJACK
endif
ifeq ($(FFTW_SUPPORT), TRUE)
CMIX_FLAGS += -DFFTW
endif
ifeq ($(MULTI_THREAD_SUPPORT), TRUE)
CMIX_FLAGS += -DMULTI_THREAD
endif
endif
INCLUDES = -I. -I$(CMIXDIR)/include $(EXTRA_INCLUDES)
CFLAGS = $(IPHONE_CFLAGS) $(INCLUDES) $(OPT) $(PICFLAGS) $(ARCHFLAGS) $(CMIX_FLAGS)
CXXFLAGS = $(IPHONE_CFLAGS) $(INCLUDES) $(OPT) $(PICFLAGS) $(ARCHFLAGS) $(CMIX_FLAGS)
# Platform-independent library flags
RTLIB = lib$(SHLIB).$(SHLIB_SUFFIX)
LIBRTCMIX = $(LIBDIR)/$(RTLIB)
RTLDFLAGS = -L$(LIBDIR) -l$(SHLIB) -lgen
# Platform-specific library flags Key:
#
# SYS_LDFLAGS: External libraries for each platform.
# SYSLIBS: Libraries which DSOs link against.
# SHARED_LDFLAGS: Linker flags when creating DSOs.
# CMIXOBJS: Non-lib .o files which standalone binaries need.
# LDFLAGS: Libraries which standalone binaries link against.
# IMBCMIXOBJS: Non-lib .o files which imbedded binaries need.
# DYNAMIC_LDFLAGS: Linker flags when creating dynamic shared libraries.
ifeq ($(ARCH),LINUX)
ifeq ($(AUDIODRIVER),ALSA)
SYS_LDFLAGS = -lasound -lpthread -lm -ldl #-lefence
else
SYS_LDFLAGS = -lpthread -lm -ldl #-lefence
endif
DSO_LDFLAGS = $(OPT) $(SYSLIBS)
SHARED_LDFLAGS = -shared -Wl,-soname,$(RTLIB)
DYNAMIC_LDFLAGS = $(SHARED_LDFLAGS)
DYN = -rdynamic
endif
ifeq ($(ARCH),MACOSX)
SYS_LDFLAGS = -framework CoreAudio $(ARCH_SYS_LDFLAGS)
DSO_LDFLAGS = $(SYS_LDFLAGS)
ifeq ($(BUILDTYPE), PD)
SHARED_LDFLAGS = $(ARCHFLAGS) -bundle
else
SHARED_LDFLAGS = $(ARCHFLAGS) -bundle -flat_namespace -undefined suppress
endif
DYNAMIC_LDFLAGS = $(ARCHFLAGS) -flat_namespace -undefined suppress -dynamiclib -install_name $(LIBDIR)/$(RTLIB)
DYN =
endif
ifeq ($(ARCH),SGI)
SYS_LDFLAGS = -lpthread -laudio -lm
DSO_LDFLAGS = $(SYS_LDFLAGS)
SHARED_LDFLAGS = -shared -update_registry $(LIBDESTDIR)/so_locations
DYNAMIC_LDFLAGS = $(SHARED_LDFLAGS)
DYN =
endif
ifeq ($(ARCH),FREEBSD)
SYS_LDFLAGS += -pthread -lm -ll
DSO_LDFLAGS = -export-dynamic $(SYS_LDFLAGS)
SHARED_LDFLAGS = -shared -Wl,-soname,$(RTLIB)
DYNAMIC_LDFLAGS = $(SHARED_LDFLAGS)
DYN = -rdynamic
endif
LDFLAGS = $(ARCH_RTLDFLAGS) $(RTLDFLAGS)
SYSLIBS = $(ARCH_RTLDFLAGS) -L$(LIBDIR) -lgen $(SYS_LDFLAGS)
# For benefit of inst makefiles that live outside CMIXDIR hierarchy
UGENS_H = $(CMIXDIR)/include/ugens.h
# for rt insts
INSTRUMENT_H = $(CMIXDIR)/include/Instrument.h
PROFILE_O = $(CMIXDIR)/src/rtcmix/profile.o
# for disk-based insts
RTPROFILE_O = $(CMIXDIR)/src/rtcmix/rtprofile.o
CMIX_O = $(LIBDIR)/main.o $(LIBDIR)/RTcmixMain.o
M_O = $(PARSERDIR)/parse_with_minc.o
IMB_RTCMIX_O =
P_O = $(PARSERDIR)/parse_with_perl.o
PY_O = $(PARSERDIR)/parse_with_python.o
CMIXOBJS = $(CMIX_O) $(M_O) $(GENLIB)
IMBCMIXOBJS = $(IMB_RTCMIX_O) $(GENLIB)
# Things to be removed by 'clean'
TRASH = core core.[0-9]+ *~
# Cool debugging feature: to see value of make macro "$(MACRO)" type "make print-MACRO"
print-%: ; @echo $* is $($*)