summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStephen Sinclair <radarsat1@gmail.com>2013-10-11 17:48:29 +0200
committerStephen Sinclair <radarsat1@gmail.com>2013-10-11 18:57:30 +0200
commitf1dc7619d501ca7c5de745213dd3784de279204c (patch)
treeb879300d9bd02f9814a743c08e51bd0f471bcc4c
parentd6fd1442b2fe1bb366c5539354eeb841fc6943a1 (diff)
Support "install" and "uninstall" targets, and support --prefix configure option.
-rw-r--r--Makefile.in21
-rw-r--r--librtaudio.pc.in2
2 files changed, 20 insertions, 3 deletions
diff --git a/Makefile.in b/Makefile.in
index 41685e5..5f41cc5 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -6,7 +6,8 @@ LN = /bin/ln
OBJECTS = RtAudio.o @objects@
-STATIC = librtaudio.a
+LIBNAME = librtaudio
+STATIC = $(LIBNAME).a
SHARED = @sharedlib@
RELEASE = 4.0.12
MAJOR = 4
@@ -19,6 +20,8 @@ RANLIB = @RANLIB@
DEFS = @CPPFLAGS@
CFLAGS = @CXXFLAGS@ -Iinclude -fPIC
+PREFIX = @prefix@
+
all : $(LIBRARIES)
tests:
@@ -37,6 +40,18 @@ $(LIBRARIES): $(OBJECTS)
%.o : include/%.cpp
$(CC) $(CFLAGS) $(DEFS) -c $(<) -o $@
+install:
+ install --mode=755 $(STATIC) $(PREFIX)/lib/
+ install --mode=755 @sharedname@ $(PREFIX)/lib/
+ $(LN) -sf @sharedname@ $(PREFIX)/lib/$(SHARED)
+ $(LN) -sf @sharedname@ $(PREFIX)/lib/$(SHARED).$(MAJOR)
+ install --mode=644 $(LIBNAME).pc $(PREFIX)/lib/pkgconfig
+ install --mode=644 RtAudio.h RtError.h $(PREFIX)/include/
+
+uninstall:
+ -@rm -vf $(patsubst %,$(PREFIX)/lib/%, $(LIBRARIES) $(SHARED).$(MAJOR) $(SHARED).$(RELEASE))
+ -@rm -vf $(PREFIX)/lib/pkgconfig/$(LIBNAME).pc
+
clean :
$(RM) -f $(LIBRARIES) @sharedname@ $(SHARED)*
$(RM) -f $(OBJECTS)
@@ -47,10 +62,12 @@ distclean:
$(RM) -f $(LIBRARIES) @sharedname@ $(SHARED)*
$(RM) -f $(OBJECTS)
$(RM) -f *~
- $(RM) -rf config.log config.status autom4te.cache Makefile rtaudio-config librtaudio.pc
+ $(RM) -rf config.log config.status autom4te.cache Makefile rtaudio-config $(LIBNAME).pc
cd tests && $(MAKE) distclean
strip :
strip $(LIBRARIES)
ranlib $(LIBRARIES)
cd tests && $(MAKE) strip
+
+.PHONY: clean distclean strip install uninstall
diff --git a/librtaudio.pc.in b/librtaudio.pc.in
index d7591a7..b4f3985 100644
--- a/librtaudio.pc.in
+++ b/librtaudio.pc.in
@@ -1,4 +1,4 @@
-prefix=/usr/local
+prefix=@prefix@
exec_prefix=${prefix}
libdir=${exec_prefix}/lib
includedir=${prefix}/include