Merge branch 'master' of https://scm.cri.ensmp.fr/git/Faustine
[Faustine.git] / interpretor / faust-0.9.47mr3 / examples / faust-stk / Makefile.mspcompile
1 dspsrc := $(wildcard *.dsp)
2 cppsrc := $(addprefix $(DEST), $(dspsrc:.dsp=.cpp))
3 appl := $(addprefix $(DEST), $(dspsrc:.dsp=~.mxo))
4 processor := $(shell uname -p)
5
6 CC=g++
7 #CC=/Developer/usr/bin/llvm-g++
8
9 INC := -I/usr/local/include/c74support/max-includes -I/usr/local/include/c74support/msp-includes -I $(PWD) -I/usr/local/lib/faust
10
11 all : $(appl)
12
13 $(DEST)%~.mxo : %.dsp Info.plist.template
14 install -d $@/Contents/MacOS
15 faust $(VEC) -g -vs 2048 -a $(ARCH) $< -o $@/$(<:.dsp=.cpp)
16 #faust -sch -g -vs 2048 $(VEC) -a $(ARCH) $< -o $@/$(<:.dsp=.cpp)
17 ifeq ($(processor), i386)
18 $(CC) -arch i386 -fpascal-strings -fasm-blocks -g -O3 $(INC) -c $@/$(<:.dsp=.cpp) -o $@/$(<:.dsp=.i386.o)
19 $(CC) -framework MaxAPI -framework Carbon -framework MaxAudioAPI -arch i386 -Wl,-Y,1455 -bundle $@/$(<:.dsp=.i386.o) -o $@/$(<:.dsp=.i386~)
20 $(CC) -arch ppc -fpascal-strings -fasm-blocks -g -O3 $(INC) -c $@/$(<:.dsp=.cpp) -o $@/$(<:.dsp=.ppc.o)
21 $(CC) -framework Carbon -framework MaxAPI -framework MaxAudioAPI -arch ppc -Wl,-Y,1455 -bundle $@/$(<:.dsp=.ppc.o) -o $@/$(<:.dsp=.ppc~)
22 sed s/FOO/$(<:.dsp=~)/ <Info.plist.template >$@/Contents/Info.plist
23 lipo -create $@/$(<:.dsp=.i386~) $@/$(<:.dsp=.ppc~) -output $@/Contents/MacOS/$(<:.dsp=~)
24 rm -f $@/$(<:.dsp=.ppc~) $@/$(<:.dsp=.ppc.o) $@/$(<:.dsp=.i386.o) $@/$(<:.dsp=.i386~)
25 else
26 g++ -arch ppc -fpascal-strings -fasm-blocks -g -O3 $(INC) -c $@/$(<:.dsp=.cpp) -o $@/$(<:.dsp=.ppc.o)
27 g++ -framework Carbon -framework MaxAPI -framework MaxAudioAPI -arch ppc -Wl,-Y,1455 -bundle $@/$(<:.dsp=.ppc.o) -o $@/$(<:.dsp=.ppc~)
28 sed s/FOO/$(<:.dsp=~)/ <Info.plist.template >$@/Contents/Info.plist
29 lipo -create $@/$(<:.dsp=.ppc~) -output $@/Contents/MacOS/$(<:.dsp=~)
30 rm -f $@/$(<:.dsp=.ppc~) $@/$(<:.dsp=.ppc.o)
31 endif
32
33 Info.plist.template :
34 echo '<?xml version="1.0" encoding="UTF-8"?>' > Info.plist.template
35 echo '<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">' >> Info.plist.template
36 echo '<plist version="1.0">' >> Info.plist.template
37 echo '<dict>' >> Info.plist.template
38 echo ' <key>CFBundleExecutable</key>' >> Info.plist.template
39 echo ' <string>FOO</string>' >> Info.plist.template
40 echo ' <key>CFBundleName</key>' >> Info.plist.template
41 echo ' <string>FOO</string>' >> Info.plist.template
42 echo ' <key>CFBundlePackageType</key>' >> Info.plist.template
43 echo ' <string>iLaX</string>' >> Info.plist.template
44 echo '</dict>' >> Info.plist.template
45 echo '</plist>' >> Info.plist.template
46
47 clean :
48 rm -f $(DEST)