Mercurial > hg > vamp-plugin-sdk
changeset 94:70bcd0b62cba
* OS/X build stuff
author | cannam |
---|---|
date | Wed, 07 Nov 2007 10:30:27 +0000 |
parents | cd72c0473341 |
children | cd4425ab7b98 |
files | Makefile Makefile.osx README |
diffstat | 3 files changed, 205 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/Makefile Fri Nov 02 14:55:12 2007 +0000 +++ b/Makefile Wed Nov 07 10:30:27 2007 +0000 @@ -85,7 +85,10 @@ HOSTSDK_DYNAMIC_LDFLAGS = $(DYNAMIC_LDFLAGS) -Wl,-soname=$(INSTALL_HOSTSDK_LIBNAME) ## For OS/X with g++: -#PLUGIN_LDFLAGS = -dynamiclib +#DYNAMIC_LDFLAGS = -dynamiclib +#PLUGIN_LDFLAGS = $(DYNAMIC_LDFLAGS) +#SDK_DYNAMIC_LDFLAGS = $(DYNAMIC_LDFLAGS) +#HOSTSDK_DYNAMIC_LDFLAGS = $(DYNAMIC_LDFLAGS) ### End of user-serviceable parts @@ -133,10 +136,10 @@ $(SDKDIR)/libvamp-hostsdk.a SDK_DYNAMIC = \ - $(SDKDIR)/libvamp-sdk.so + $(SDKDIR)/libvamp-sdk$(PLUGIN_EXT) HOSTSDK_DYNAMIC = \ - $(SDKDIR)/libvamp-hostsdk.so + $(SDKDIR)/libvamp-hostsdk$(PLUGIN_EXT) SDK_LA = \ $(SDKDIR)/libvamp-sdk.la
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Makefile.osx Wed Nov 07 10:30:27 2007 +0000 @@ -0,0 +1,196 @@ + +# Makefile for the Vamp plugin SDK. This builds the SDK objects, +# libraries, example plugins, and the test host. Please adjust to +# suit your operating system requirements. +# +# This version of the Makefile is approximately correct for OS/X. +# Note that it has no "install" target; the following are the +# library and related files that may be of interest resulting from +# the build: +# +# vamp-sdk/libvamp-sdk.dylib [SDK dynamic library for plugins] +# vamp-sdk/libvamp-hostsdk.dylib [SDK dynamic library for hosts] +# +# vamp-sdk/libvamp-sdk.a [SDK static library for plugins] +# vamp-sdk/libvamp-hostsdk.a [SDK static library for hosts] +# +# examples/vamp-example-plugins.cat [copy this to your Vamp plugin dir] +# examples/vamp-example-plugins.dylib [copy this to your Vamp plugin dir] +# +# host/vamp-simple-host [requires libsndfile to build] + +APIDIR = vamp +SDKDIR = vamp-sdk +HOSTEXTDIR = vamp-sdk/hostext +EXAMPLEDIR = examples +HOSTDIR = host + +### +### Start of user-serviceable parts +### + +# Default build target (or use "make <target>" to select one). +# Targets are: +# all -- build everything +# sdk -- build all the Vamp SDK libraries for plugins and hosts +# sdkstatic -- build only the static versions of the SDK libraries +# plugins -- build the example plugins (and the SDK if required) +# host -- build the simple Vamp plugin host (and the SDK if required) +# test -- build the host and example plugins, and run a quick test +# clean -- remove binary targets +# distclean -- remove all targets +# +default: all + +# Compile flags +# +CXXFLAGS := $(CXXFLAGS) -O2 -Wall -I. -fPIC + +# ar, ranlib +# +AR := ar +RANLIB := ranlib + +# Libraries required for the plugins. +# (Note that it is desirable to statically link libstdc++ if possible, +# because our plugin exposes only a C API so there are no boundary +# compatibility problems.) +# +PLUGIN_LIBS = $(SDKDIR)/libvamp-sdk.a + +# File extension for a dynamically loadable object +# +PLUGIN_EXT = .dylib + +# Libraries required for the host. +# +HOST_LIBS = $(SDKDIR)/libvamp-hostsdk.a -lsndfile -ldl + +# Flags required to tell the compiler to create a dynamically loadable object +# +DYNAMIC_LDFLAGS = -dynamiclib +PLUGIN_LDFLAGS = $(DYNAMIC_LDFLAGS) +SDK_DYNAMIC_LDFLAGS = $(DYNAMIC_LDFLAGS) +HOSTSDK_DYNAMIC_LDFLAGS = $(DYNAMIC_LDFLAGS) + + +### End of user-serviceable parts + + +API_HEADERS = \ + $(APIDIR)/vamp.h + +SDK_HEADERS = \ + $(SDKDIR)/Plugin.h \ + $(SDKDIR)/PluginAdapter.h \ + $(SDKDIR)/PluginBase.h \ + $(SDKDIR)/RealTime.h + +HOSTSDK_HEADERS = \ + $(SDKDIR)/Plugin.h \ + $(SDKDIR)/PluginBase.h \ + $(SDKDIR)/PluginHostAdapter.h \ + $(SDKDIR)/RealTime.h + +HOSTEXT_HEADERS = \ + $(HOSTEXTDIR)/PluginBufferingAdapter.h \ + $(HOSTEXTDIR)/PluginChannelAdapter.h \ + $(HOSTEXTDIR)/PluginInputDomainAdapter.h \ + $(HOSTEXTDIR)/PluginLoader.h \ + $(HOSTEXTDIR)/PluginWrapper.h + +SDK_OBJECTS = \ + $(SDKDIR)/PluginAdapter.o \ + $(SDKDIR)/RealTime.o + +HOSTSDK_OBJECTS = \ + $(SDKDIR)/PluginHostAdapter.o \ + $(HOSTEXTDIR)/PluginBufferingAdapter.o \ + $(HOSTEXTDIR)/PluginChannelAdapter.o \ + $(HOSTEXTDIR)/PluginInputDomainAdapter.o \ + $(HOSTEXTDIR)/PluginLoader.o \ + $(HOSTEXTDIR)/PluginWrapper.o \ + $(SDKDIR)/RealTime.o + +SDK_STATIC = \ + $(SDKDIR)/libvamp-sdk.a + +HOSTSDK_STATIC = \ + $(SDKDIR)/libvamp-hostsdk.a + +SDK_DYNAMIC = \ + $(SDKDIR)/libvamp-sdk$(PLUGIN_EXT) + +HOSTSDK_DYNAMIC = \ + $(SDKDIR)/libvamp-hostsdk$(PLUGIN_EXT) + +SDK_LA = \ + $(SDKDIR)/libvamp-sdk.la + +HOSTSDK_LA = \ + $(SDKDIR)/libvamp-hostsdk.la + +PLUGIN_HEADERS = \ + $(EXAMPLEDIR)/SpectralCentroid.h \ + $(EXAMPLEDIR)/PercussionOnsetDetector.h \ + $(EXAMPLEDIR)/AmplitudeFollower.h \ + $(EXAMPLEDIR)/ZeroCrossing.h + +PLUGIN_OBJECTS = \ + $(EXAMPLEDIR)/SpectralCentroid.o \ + $(EXAMPLEDIR)/PercussionOnsetDetector.o \ + $(EXAMPLEDIR)/AmplitudeFollower.o \ + $(EXAMPLEDIR)/ZeroCrossing.o \ + $(EXAMPLEDIR)/plugins.o + +PLUGIN_TARGET = \ + $(EXAMPLEDIR)/vamp-example-plugins$(PLUGIN_EXT) + +HOST_HEADERS = \ + $(HOSTDIR)/system.h + +HOST_OBJECTS = \ + $(HOSTDIR)/vamp-simple-host.o + +HOST_TARGET = \ + $(HOSTDIR)/vamp-simple-host + +sdk: sdkstatic $(SDK_DYNAMIC) $(HOSTSDK_DYNAMIC) + +sdkstatic: $(SDK_STATIC) $(HOSTSDK_STATIC) + $(RANLIB) $(SDK_STATIC) + $(RANLIB) $(HOSTSDK_STATIC) + +plugins: $(PLUGIN_TARGET) + +host: $(HOST_TARGET) + +all: sdk plugins host test + +$(SDK_STATIC): $(SDK_OBJECTS) $(API_HEADERS) $(SDK_HEADERS) + $(AR) r $@ $(SDK_OBJECTS) + +$(HOSTSDK_STATIC): $(HOSTSDK_OBJECTS) $(API_HEADERS) $(HOSTSDK_HEADERS) $(HOSTEXT_HEADERS) + $(AR) r $@ $(HOSTSDK_OBJECTS) + +$(SDK_DYNAMIC): $(SDK_OBJECTS) $(API_HEADERS) $(SDK_HEADERS) + $(CXX) $(LDFLAGS) $(SDK_DYNAMIC_LDFLAGS) -o $@ $(SDK_OBJECTS) + +$(HOSTSDK_DYNAMIC): $(HOSTSDK_OBJECTS) $(API_HEADERS) $(HOSTSDK_HEADERS) $(HOSTEXT_HEADERS) + $(CXX) $(LDFLAGS) $(HOSTSDK_DYNAMIC_LDFLAGS) -o $@ $(HOSTSDK_OBJECTS) + +$(PLUGIN_TARGET): $(PLUGIN_OBJECTS) $(SDK_STATIC) $(PLUGIN_HEADERS) + $(CXX) $(LDFLAGS) $(PLUGIN_LDFLAGS) -o $@ $(PLUGIN_OBJECTS) $(PLUGIN_LIBS) + +$(HOST_TARGET): $(HOST_OBJECTS) $(HOSTSDK_STATIC) $(HOST_HEADERS) + $(CXX) $(LDFLAGS) $(HOST_LDFLAGS) -o $@ $(HOST_OBJECTS) $(HOST_LIBS) + +test: plugins host + VAMP_PATH=$(EXAMPLEDIR) $(HOST_TARGET) -l + +clean: + rm -f $(SDK_OBJECTS) $(HOSTSDK_OBJECTS) $(PLUGIN_OBJECTS) $(HOST_OBJECTS) + +distclean: clean + rm -f $(SDK_STATIC) $(SDK_DYNAMIC) $(HOSTSDK_STATIC) $(HOSTSDK_DYNAMIC) $(PLUGIN_TARGET) $(HOST_TARGET) *~ */*~ +
--- a/README Fri Nov 02 14:55:12 2007 +0000 +++ b/README Wed Nov 07 10:30:27 2007 +0000 @@ -179,6 +179,9 @@ Makefile to suit your platform according to the comments in it, then run "make". +There is a ready-tweaked Makefile for use on OS/X; to use it, run +"make -f Makefile.osx". + To use an IDE to build a plugin or host using the Vamp SDK, simply add the .cpp files in the vamp-sdk directory to your project.