Examples' Makefiles are completed and tested.
[Faustine.git] / interpretor / preprocessor / faust-0.9.47mr3 / examples / 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 lipo -create $@/$(<:.dsp=.i386~) -output $@/Contents/MacOS/$(<:.dsp=~)
25 rm -f $@/$(<:.dsp=.ppc~) $@/$(<:.dsp=.ppc.o) $@/$(<:.dsp=.i386.o) $@/$(<:.dsp=.i386~)
26 else
27 g++ -arch ppc -fpascal-strings -fasm-blocks -g -O3 $(INC) -c $@/$(<:.dsp=.cpp) -o $@/$(<:.dsp=.ppc.o)
28 g++ -framework Carbon -framework MaxAPI -framework MaxAudioAPI -arch ppc -Wl,-Y,1455 -bundle $@/$(<:.dsp=.ppc.o) -o $@/$(<:.dsp=.ppc~)
29 sed s/FOO/$(<:.dsp=~)/ <Info.plist.template >$@/Contents/Info.plist
30 lipo -create $@/$(<:.dsp=.ppc~) -output $@/Contents/MacOS/$(<:.dsp=~)
31 rm -f $@/$(<:.dsp=.ppc~) $@/$(<:.dsp=.ppc.o)
32 endif
33
34 Info.plist.template :
35 echo '<?xml version="1.0" encoding="UTF-8"?>' > Info.plist.template
36 echo '<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">' >> Info.plist.template
37 echo '<plist version="1.0">' >> Info.plist.template
38 echo '<dict>' >> Info.plist.template
39 echo ' <key>CFBundleExecutable</key>' >> Info.plist.template
40 echo ' <string>FOO</string>' >> Info.plist.template
41 echo ' <key>CFBundleName</key>' >> Info.plist.template
42 echo ' <string>FOO</string>' >> Info.plist.template
43 echo ' <key>CFBundlePackageType</key>' >> Info.plist.template
44 echo ' <string>iLaX</string>' >> Info.plist.template
45 echo '</dict>' >> Info.plist.template
46 echo '</plist>' >> Info.plist.template
47
48 clean :
49 rm -f $(DEST)