### RtAudio tests Makefile - for various flavors of unix

PROGRAMS = info play_saw record_raw in_out play_raw twostreams call_saw call_inout
RM = /bin/rm
SRC_PATH = ../
INCLUDE = ../
OBJECT_PATH = @object_path@
vpath %.o $(OBJECT_PATH)

OBJECTS	=	RtAudio.o

CC       = @CXX@
DEFS     = @debug@
DEFS    += @audio_apis@
CFLAGS   = @cflags@
CFLAGS  += @warn@ -I$(INCLUDE)
LIBRARY  = @LIBS@
LIBRARY += @frameworks@

%.o : $(SRC_PATH)/%.cpp
	$(CC) $(CFLAGS) $(DEFS) -c $(<) -o $(OBJECT_PATH)/$@

all : $(PROGRAMS)

info : info.cpp $(OBJECTS)
	$(CC) $(CFLAGS) $(DEFS) -o info info.cpp $(OBJECT_PATH)/RtAudio.o $(LIBRARY)

play_saw : play_saw.cpp $(OBJECTS)
	$(CC) $(CFLAGS) $(DEFS) -o play_saw play_saw.cpp $(OBJECT_PATH)/RtAudio.o $(LIBRARY)

play_raw : play_raw.cpp $(OBJECTS)
	$(CC) $(CFLAGS) $(DEFS) -o play_raw play_raw.cpp $(OBJECT_PATH)/RtAudio.o $(LIBRARY)

record_raw : record_raw.cpp $(OBJECTS)
	$(CC) $(CFLAGS) $(DEFS) -o record_raw record_raw.cpp $(OBJECT_PATH)/RtAudio.o $(LIBRARY)

in_out : in_out.cpp $(OBJECTS)
	$(CC) $(CFLAGS) $(DEFS) -o in_out in_out.cpp $(OBJECT_PATH)/RtAudio.o $(LIBRARY)

twostreams : twostreams.cpp $(OBJECTS)
	$(CC) $(CFLAGS) $(DEFS) -o twostreams twostreams.cpp $(OBJECT_PATH)/RtAudio.o $(LIBRARY)

call_saw : call_saw.cpp $(OBJECTS)
	$(CC) $(CFLAGS) $(DEFS) -o call_saw call_saw.cpp $(OBJECT_PATH)/RtAudio.o $(LIBRARY)

call_inout : call_inout.cpp $(OBJECTS)
	$(CC) $(CFLAGS) $(DEFS) -o call_inout call_inout.cpp $(OBJECT_PATH)/RtAudio.o $(LIBRARY)

clean : 
	-rm -f $(OBJECT_PATH)/*.o
	-rm -f $(PROGRAMS)
	-rm -f *~

distclean: clean
	-rm -f Makefile

strip : 
	strip $(PROGRAMS)
