forked from eberdahl/SaM
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile.mspcompile
60 lines (48 loc) · 2.18 KB
/
Makefile.mspcompile
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
#-------------------------------------------------------------------------------#
# Makefile to produce Max MSP externals on MacOSX
#
#-------------------------------------------------------------------------------
# Lists dsp file we have to compile
dspsrc := $(wildcard *.mdl)
cppsrc := $(addprefix $(DEST), $(dspsrc:.mdl=.cpp))
appl := $(addprefix $(DEST), $(dspsrc:.mdl=~.mxo))
dspfile := $(dspsrc:.mdl=.dsp)
mdxfile := $(dspsrc:.mdl=.mdx)
processor := $(shell uname -p)
# Path to Max/MSP SDK
#SDK :=/usr/local/include/c74support/
SDK :=/Applications/Max5/MaxSDK-5.1.7/c74support/
MAXINC :=$(SDK)/max-includes -I/usr/local/lib/faust
MSPINC :=$(SDK)/msp-includes
# MacOSX Frameworks we are going to use
FRAMEWORKS := -framework Carbon -I$(MAXINC) -I$(MSPINC) -F$(MAXINC) -F$(MSPINC) -framework MaxAPI -framework MaxAudioAPI
# Compilation and optimisation options
OPTIONS := -arch i386 -O3 -mfpmath=sse -msse -msse2 -msse3 -ffast-math -Wl,-Y,1455 -bundle
# Which compiler we use
CC=g++
#CC=/Developer/usr/bin/llvm-g++
all : $(mdxfile) $(dspfile) $(appl)
%.mdx : %.mdl
perl SAM-preprocessor $< $@
%.dsp : %.mdx
perl Synth-A-Modeler $< $@
$(DEST)%~.mxo : %.dsp Info.plist.template
install -d $@/Contents/MacOS
faust $(VEC) -a $(ARCH) $< -o $@/$(<:.dsp=.cpp)
$(CC) $(FRAMEWORKS) $(OPTIONS) $@/$(<:.dsp=.cpp) -o $@/Contents/MacOS/$(<:.dsp=~)
sed s/FOO/$(<:.dsp=~)/ <Info.plist.template >$@/Contents/Info.plist
Info.plist.template :
echo '<?xml version="1.0" encoding="UTF-8"?>' > Info.plist.template
echo '<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">' >> Info.plist.template
echo '<plist version="1.0">' >> Info.plist.template
echo '<dict>' >> Info.plist.template
echo ' <key>CFBundleExecutable</key>' >> Info.plist.template
echo ' <string>FOO</string>' >> Info.plist.template
echo ' <key>CFBundleName</key>' >> Info.plist.template
echo ' <string>FOO</string>' >> Info.plist.template
echo ' <key>CFBundlePackageType</key>' >> Info.plist.template
echo ' <string>iLaX</string>' >> Info.plist.template
echo '</dict>' >> Info.plist.template
echo '</plist>' >> Info.plist.template
clean :
rm -f $(DEST)