### Do not edit -- Generated by 'configure --with-whatever' from Makefile.in
### RtAudio library Makefile

RM = /bin/rm
LN = /bin/ln

OBJECTS	= RtAudio.o 

STATIC = librtaudio.a
SHARED = librtaudio.so
RELEASE = 4.0.11
MAJOR = 4
LIBRARIES = $(STATIC) $(SHARED)

CC       = g++
AR       = /usr/bin/ar
RANLIB   = ranlib

DEFS     =   -DHAVE_GETTIMEOFDAY -D__LINUX_ALSA__
CFLAGS   = -O2 -Wall -Iinclude -fPIC

all : $(LIBRARIES)

tests:
	cd tests && $(MAKE) all

$(LIBRARIES): $(OBJECTS)
	$(AR) ruv $(STATIC) $(OBJECTS)
	ranlib $(STATIC)
	$(CC) -fPIC -shared -Wl,-soname,$(SHARED).$(MAJOR) -o $(SHARED).$(RELEASE) $(OBJECTS) -lpthread -lasound 
	$(LN) -s librtaudio.so.$(RELEASE) $(SHARED)

#	$(CC) -shared $(OBJECTS) -o $(SHARED) -lpthread -lasound 

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

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

clean : 
	$(RM) -f $(LIBRARIES) librtaudio.so.$(RELEASE) $(SHARED)*
	$(RM) -f $(OBJECTS)
	$(RM) -f *~
	cd tests && $(MAKE) clean

distclean:
	$(RM) -f $(LIBRARIES) librtaudio.so.$(RELEASE) $(SHARED)*
	$(RM) -f $(OBJECTS)
	$(RM) -f *~
	$(RM) -rf config.log config.status autom4te.cache Makefile rtaudio-config
	cd tests && $(MAKE) distclean

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