### RtAudio library Makefile

RM = /bin/rm

OBJECTS	= RtAudio.o

LIBRARY  = librtaudio.a

CC       = @CXX@
AR       = @AR@
RANLIB   = @RANLIB@

DEFS     = @debug@
DEFS    += @audio_apis@
CFLAGS   = @cflags@
CFLAGS  += @warn@

all : $(LIBRARY)

tests:
	cd tests && $(MAKE) all

$(LIBRARY): $(OBJECTS)
	$(AR) ruv $(LIBRARY) $(OBJECTS)
	ranlib $(LIBRARY)

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

clean : 
	-rm -f $(LIBRARY)
	-rm -f $(OBJECTS)
	-rm -f *~
	cd tests && $(MAKE) clean

distclean: clean
	-rm -rf config.log autom4te.cache Makefile rtaudio-config
	cd tests && $(MAKE) distclean

strip : 
	strip $(LIBRARY)
	ranlib $(LIBRARY)
	cd tests && $(MAKE) strip
