diff options
author | Jamie Bullock <jamie@postlude.co.uk> | 2010-08-23 11:28:39 +0000 |
---|---|---|
committer | Jamie Bullock <jamie@postlude.co.uk> | 2010-08-23 11:28:39 +0000 |
commit | d128e363fe30da5109d3344232ede924b62606ed (patch) | |
tree | dd89acc3f413b456f660ab8546b918ec1d08c2f2 /examples | |
parent | 42b2b09b9146e7fd74233b9529c398fa11dd1ab1 (diff) | |
download | LibXtract-d128e363fe30da5109d3344232ede924b62606ed.tar.gz LibXtract-d128e363fe30da5109d3344232ede924b62606ed.tar.bz2 LibXtract-d128e363fe30da5109d3344232ede924b62606ed.zip |
- Max example tweaks
- corrected output display in simpletest example
Diffstat (limited to 'examples')
-rw-r--r-- | examples/MSP/Makefile | 31 | ||||
-rw-r--r-- | examples/MSP/test/xtract-test.pat (renamed from examples/MSP/test/xtract-test) | 0 | ||||
-rw-r--r-- | examples/simpletest/simpletest.c | 2 |
3 files changed, 23 insertions, 10 deletions
diff --git a/examples/MSP/Makefile b/examples/MSP/Makefile index 8a8b7f1..e6d1ffd 100644 --- a/examples/MSP/Makefile +++ b/examples/MSP/Makefile @@ -4,22 +4,28 @@ CSYM=xtract~ all: universal
current: universal
-MAXINCLUDE = /usr/local/include/max-includes
-MSPINCLUDE = /usr/local/include/msp-includes
FRAMEWORKS = /Library/Frameworks
-INSTALLDIR = /Applications/Audio/MaxMSP\ 4.6.3/Cycling\ \'74/externals/
+MAXINCLUDE = $(FRAMEWORKS)/MaxAPI.framework/Headers
+MSPINCLUDE = $(FRAMEWORKS)/MaxAudioAPI.framework/Headers
+INSTALLDIR = /Applications/Max5/Cycling\ \'74/externals/
+XTRACT_HEADERS = /usr/local/include
+FFTW_LIBS = -lfftw3f #include this if you compiled libxtract with --enable-fft
LIPO = /usr/bin/lipo
CC = gcc
-CFLAGS = -F$(FRAMEWORKS) -Wmost -Wno-four-char-constants -Wno-unknown-pragmas -x c -pipe -Wno-trigraphs -fpascal-strings -fasm-blocks -Os -fmessage-length=0 -I$(MAXINCLUDE) -I$(MSPINCLUDE) -include macho-prefix.h -Werror
+#DEBUG_FLAGS = -Werror -Wall
+
+CFLAGS = -F$(FRAMEWORKS) -Wmost -Wno-four-char-constants -Wno-unknown-pragmas -x c -pipe -Wno-trigraphs -fpascal-strings -fasm-blocks -Os -fmessage-length=0 -I$(MAXINCLUDE) -I$(MSPINCLUDE) -include macho-prefix.pch $(DEBUG_FLAGS) -isysroot /Developer/SDKs/MacOSX10.5.sdk -mmacosx-version-min=10.5 -I$(XTRACT_HEADERS)
I386CFLAGS = -arch i386
+IX86_64CFLAGS = -arch x86_64
PPCCFLAGS = -arch ppc -faltivec -fasm-blocks -Wno-unused
-LDFLAGS = -F$(FRAMEWORKS) -L$(MAXINCLUDE) -L$(MSPINCLUDE) -framework Carbon -framework MaxAPI -framework MaxAudioAPI -Wl,-Y,1455 -bundle -L/usr/local/lib -lxtract
+LDFLAGS = -F$(FRAMEWORKS) -L$(MAXINCLUDE) -L$(MSPINCLUDE) -framework Carbon -framework MaxAPI -framework MaxAudioAPI -Wl,-Y,1455 -bundle -L/usr/local/lib -lxtract $(FFTW_LIBS)
I386LDFLAGS = -arch i386
+IX86_64CFLAGS = -arch x86_64
PPCLDFLAGS = -arch ppc
universal:
@@ -48,11 +54,18 @@ intel: cp Info.plist PkgInfo $(NAME).mxo/Contents/
cp $(NAME) $(NAME).mxo/Contents/MacOS
-clean:
- rm -rf *i386* *ppc* xtract~ *.mxo
+intel64:
+ $(CC) $(CFLAGS) $(IX86_64CFLAGS) -o $(NAME)-64.o -c $(NAME).c
+ $(CC) $(LDFLAGS) $(IX86_64LDFLAGS) -o $(NAME)-64 $(NAME)-64.o
+ $(LIPO) -create $(NAME)-64 -output $(NAME)
+ mkdir -p $(NAME).mxo/Contents/MacOS
+ cp Info.plist PkgInfo $(NAME).mxo/Contents/
+ cp $(NAME) $(NAME).mxo/Contents/MacOS
+
-maintainer-clean:
- rm -rf *i386* *ppc* xtract~ *.mxo
+
+clean:
+ rm -rf *64* *i386* *ppc* xtract~ *.mxo
install:
$(INSTALL) cp -r $(NAME).mxo $(INSTALLDIR)
diff --git a/examples/MSP/test/xtract-test b/examples/MSP/test/xtract-test.pat index 72394bf..72394bf 100644 --- a/examples/MSP/test/xtract-test +++ b/examples/MSP/test/xtract-test.pat diff --git a/examples/simpletest/simpletest.c b/examples/simpletest/simpletest.c index b17da16..6a83521 100644 --- a/examples/simpletest/simpletest.c +++ b/examples/simpletest/simpletest.c @@ -37,7 +37,7 @@ int main(void) { xtract_init_fft(N, XTRACT_SPECTRUM); xtract[XTRACT_SPECTRUM]((void *)&vector, N, &argf[0], (void *)&spectrum[0]); - printf("\nThe mean of [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] = %.1f\n\n", mean); + printf("\nThe mean of [.1, .2, .3, .4, -.5, -.4, -.3, -.2, -.1] = %.1f\n\n", mean); printf("\nResults of xtract_spectrum():\n"); for(n = 0; n < N; n++){ |