a35787be5400b8155395c5a56e90986f96b2e779
3 #####################################################################
5 # Compiles Faust programs to Max/MSP #
8 #####################################################################
12 echo '<?xml version="1.0" encoding="UTF-8"?>'
13 echo '<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">'
14 echo '<plist version="1.0">'
16 echo ' <key>CFBundleExecutable</key>'
17 echo " <string>$1</string>"
18 echo ' <key>CFBundleName</key>'
19 echo " <string>$1</string>"
20 echo ' <key>CFBundlePackageType</key>'
21 echo ' <string>iLaX</string>'
28 #-------------------------------------------------------------------
29 # Analyze command arguments :
30 # faust options -> OPTIONS
31 # if -omp : -openmp or -fopenmp -> OPENMP
32 # existing *.dsp files -> FILES
35 # PHASE 1 : Look for -icc option to force use of intel icc (actually icpc)
36 # without having to configure CXX and CXXFLAGS
38 if [ "$p" = -icc ]; then
40 CXXFLAGS
='-O3 -xT -ftz -fno-alias -fp-model fast=2'
44 #PHASE 2 : dispatch command arguments
46 if [ "$p" = -omp ]; then
47 if [[ $CXX == "icpc" ]]; then
54 if [ "$p" = -icc ]; then
56 elif [ ${p:0:1} = "-" ]; then
58 elif [[ -e "$p" ]]; then
67 #-------------------------------------------------------------------
68 # Check darwin specifics
70 if [[ $
(uname
) == Darwin
]]; then
75 #-------------------------------------------------------------------
76 # compile the *.dsp files
78 PATH
=$PATH:/usr
/local
/bin
82 #INC=-I/usr/local/include/c74support/max-includes -I/usr/local/include/c74support/msp-includes
87 SRCDIR
=$
(dirname "$p")
89 # creates a temporary dir
90 TDR
=$
(mktemp
-d faust.XXX
)
94 # compile faust to c++
95 faust
-a max-msp.cpp
$OPTIONS "$SRCDIR/$f" -o "$TMP/${f%.dsp}.cpp"
97 # compile c++ to binary
100 install -d "${f%.dsp}$EXT/Contents/MacOS"
101 $CC -arch i386
-fpascal-strings -fasm-blocks -g -O3 -I/usr
/local
/lib
/faust
-I/usr
/local
/include
/c74support
/max-includes
-I/usr
/local
/include
/c74support
/msp-includes
-c "${f%.dsp}.cpp" -o "${f%.dsp}.i386.o"
102 $CC -framework MaxAPI
-framework Carbon
-framework MaxAudioAPI
-arch i386
-Wl,-Y,1455 -bundle "${f%.dsp}.i386.o" -o "${f%.dsp}.i386~"
103 #$CC -arch ppc -fpascal-strings -fasm-blocks -g -O3 -I/usr/local/lib/faust -I/usr/local/include/c74support/max-includes -I/usr/local/include/c74support/msp-includes -c "${f%.dsp}.cpp" -o "${f%.dsp}.ppc.o"
104 #$CC -framework Carbon -framework MaxAPI -framework MaxAudioAPI -arch ppc -Wl,-Y,1455 -bundle "${f%.dsp}.ppc.o" -o "${f%.dsp}.ppc~"
105 createInfoPList
"${f%.dsp}~" "${f%.dsp}$EXT/Contents/Info.plist"
106 #lipo -create "${f%.dsp}.i386~" "${f%.dsp}.ppc~" -output "${f%.dsp}$EXT/Contents/MacOS/${f%.dsp}~"
107 lipo
-create "${f%.dsp}.i386~" -output "${f%.dsp}$EXT/Contents/MacOS/${f%.dsp}~"
111 rm -rf "$SRCDIR/${f%.dsp}$EXT"
113 # Keep .dsp and .cpp files in the plug-in
114 cp "$TMP/${f%.dsp}.cpp" "$TMP/${f%.dsp}$EXT"
115 cp "$SRCDIR/$f" "$TMP/${f%.dsp}$EXT"
117 cp -r "$TMP/${f%.dsp}$EXT" "$SRCDIR/${f%.dsp}$EXT"
120 # collect binary file name for FaustGIDE
121 BINARIES
="$BINARIES$SRCDIR/${f%.dsp}$EXT;"