Release 4.0.12 tarball
[rtaudio.git] / Makefile.in
index 23a444fd3782be04fe5a1eba6fa80728c9590b96..41685e5ffab731118a1851244f25d5b961e19644 100644 (file)
@@ -2,28 +2,34 @@
 ### RtAudio library Makefile
 
 RM = /bin/rm
+LN = /bin/ln
 
 OBJECTS        = RtAudio.o @objects@
 
-LIBRARY  = librtaudio.a
+STATIC = librtaudio.a
+SHARED = @sharedlib@
+RELEASE = 4.0.12
+MAJOR = 4
+LIBRARIES = $(STATIC) $(SHARED)
 
 CC       = @CXX@
 AR       = @AR@
 RANLIB   = @RANLIB@
 
-DEFS     = @debug@
-DEFS    += @audio_apis@
-CFLAGS   = @CFLAGS@ -Iinclude
-CFLAGS  += @warn@
+DEFS     = @CPPFLAGS@
+CFLAGS   = @CXXFLAGS@ -Iinclude -fPIC
 
-all : $(LIBRARY)
+all : $(LIBRARIES)
 
 tests:
        cd tests && $(MAKE) all
 
-$(LIBRARY): $(OBJECTS)
-       $(AR) ruv $(LIBRARY) $(OBJECTS)
-       ranlib $(LIBRARY)
+$(LIBRARIES): $(OBJECTS)
+       $(AR) ruv $(STATIC) $(OBJECTS)
+       ranlib $(STATIC)
+       $(CC) -fPIC @libflags@ $(OBJECTS) @LIBS@
+       $(LN) -sf @sharedname@ $(SHARED)
+       $(LN) -sf @sharedname@ $(SHARED).$(MAJOR)
 
 %.o : %.cpp
        $(CC) $(CFLAGS) $(DEFS) -c $(<) -o $@
@@ -32,16 +38,19 @@ $(LIBRARY): $(OBJECTS)
        $(CC) $(CFLAGS) $(DEFS) -c $(<) -o $@
 
 clean : 
-       -rm -f $(LIBRARY)
-       -rm -f $(OBJECTS)
-       -rm -f *~
+       $(RM) -f $(LIBRARIES) @sharedname@ $(SHARED)*
+       $(RM) -f $(OBJECTS)
+       $(RM) -f *~
        cd tests && $(MAKE) clean
 
-distclean: clean
-       -rm -rf config.log autom4te.cache Makefile rtaudio-config
+distclean:
+       $(RM) -f $(LIBRARIES) @sharedname@ $(SHARED)*
+       $(RM) -f $(OBJECTS)
+       $(RM) -f *~
+       $(RM) -rf config.log config.status autom4te.cache Makefile rtaudio-config librtaudio.pc
        cd tests && $(MAKE) distclean
 
 strip : 
-       strip $(LIBRARY)
-       ranlib $(LIBRARY)
+       strip $(LIBRARIES)
+       ranlib $(LIBRARIES)
        cd tests && $(MAKE) strip