#
# Makefile for Siren DLLCC plug-ins
#	Stephen Travis Pope -- stp@create.ucsb.edu -- 2001.07.16
#		LasrEditDate: 2003.12.16
#
#	These commands are for Mac OSX; for other platforms,
#	please see the DLLCC documentation for that platform.
#

# Edit your own include paths in here

CFLAGS = -O2 -fno-common -dynamic -I../../7.2/DLLC/dllcc/src

# These are specific to Mac OS X

# LINKOPTS = -lcc_dynamic -dynamic -bundle -flat_namespace -undefined suppress /usr/lib/bundle1.o
LINKOPTS = -dynamic -bundle -flat_namespace -bind_at_load -bundle_loader /Developer/VisualWorks/7.2/bin/macx/visual.app/Contents/MacOS/visual -undefined suppress /usr/lib/bundle1.o -lgcc
# LINKOPTS = -dynamic -dylinker -flat_namespace -undefined suppress -lgcc
# LINKOPTS = -dynamic -flat_namespace -undefined suppress -lgcc

# build all by default

now:	portmidi portaudio sndfile # fftw

all:	sndfile portaudio portmidi # fftw

# libsndfile plug-in

sndfile:	sndfile_lite.c
	cc -c sndfile_lite.c $(CFLAGS)
	ld -o sndfile_lite.dylib sndfile_lite.o $(LINKOPTS) -lsndfile -L/usr/local/lib

# portaudio plug-in

portaudio:	portaudio_lite.c
	cc -c portaudio_lite.c $(CFLAGS)
	ld -o portaudio_lite.dylib portaudio_lite.o $(LINKOPTS) -lportaudio -L/usr/local/lib 

# portmidi plug-in

portmidi:	portmidi_lite.c
	cc -c portmidi_lite.c $(CFLAGS)
	ld -o portmidi_lite.dylib portmidi_lite.o \
		/System/Library/Frameworks/CoreMIDI.framework/Versions/Current/CoreMIDI \
		$(LINKOPTS) -lportmidi -L/usr/local/lib 

# FFTW plug-in

fftw:	fftw_lite.c
	cc -c fftw_lite.c $(CFLAGS)
	ld -o fftw_lite.dylib fftw_lite.o $(LINKOPTS) -lfftw3f -L/usr/local/lib 

# clean-up target

clean:
	rm -f *.o *.dylib

