cannam@0: cannam@10: # Makefile for the Vamp plugin SDK. This builds the SDK objects, cannam@10: # example plugins, and the test host. Please adjust to suit your cannam@10: # operating system requirements. cannam@0: cannam@10: SDKDIR = vamp-sdk cannam@10: APIDIR = vamp cannam@10: EXAMPLEDIR = examples cannam@10: HOSTDIR = host cannam@1: cannam@0: cannam@10: ### Start of user-serviceable parts cannam@1: cannam@10: # Compile flags cannam@10: CXXFLAGS := $(CXXFLAGS) -O2 -Wall -I$(SDKDIR) -I$(APIDIR) -I. cannam@1: cannam@10: # Libraries required for the host at link time cannam@10: HOST_LIBS = -ldl cannam@0: cannam@10: # Libraries required for the plugin. Note that we can (and actively cannam@10: # want to) statically link with libstdc++, because our plugin exposes cannam@10: # a C API so there are no boundary compatibility problems. cannam@10: #PLUGIN_LIBS = $(shell g++ -print-file-name=libstdc++.a) cannam@0: cannam@10: # Flags required to tell the compiler to link to a dynamically loadable object cannam@10: PLUGIN_LDFLAGS = -shared -Wl,-Bsymbolic -static-libgcc cannam@10: cannam@10: # File extension for a dynamically loadable object cannam@10: PLUGIN_EXT = .so cannam@10: cannam@10: ## For OS/X with g++: cannam@10: #PLUGIN_LDFLAGS = -dynamiclib cannam@10: #PLUGIN_EXT = .dylib cannam@10: cannam@10: ### End of user-serviceable parts cannam@10: cannam@10: cannam@10: PLUGIN_OBJECTS = \ cannam@10: $(SDKDIR)/PluginAdapter.o \ cannam@10: $(SDKDIR)/PluginHostAdapter.o \ cannam@10: $(SDKDIR)/RealTime.o \ cannam@10: $(EXAMPLEDIR)/ZeroCrossing.o \ cannam@10: $(EXAMPLEDIR)/SpectralCentroid.o \ cannam@10: $(EXAMPLEDIR)/plugins.o cannam@10: cannam@10: PLUGIN_TARGET = \ cannam@10: $(EXAMPLEDIR)/plugins$(PLUGIN_EXT) cannam@10: cannam@10: HOST_OBJECTS = \ cannam@10: $(SDKDIR)/PluginAdapter.o \ cannam@10: $(SDKDIR)/PluginHostAdapter.o \ cannam@10: $(SDKDIR)/RealTime.o \ cannam@10: $(HOSTDIR)/simplehost.o cannam@10: cannam@10: HOST_TARGET = \ cannam@10: $(HOSTDIR)/simplehost cannam@10: cannam@10: all: $(PLUGIN_TARGET) $(HOST_TARGET) test cannam@10: cannam@10: $(PLUGIN_TARGET): $(PLUGIN_OBJECTS) cannam@10: $(CXX) $(LDFLAGS) $(PLUGIN_LDFLAGS) -o $@ $^ $(PLUGIN_LIBS) cannam@10: cannam@10: $(HOST_TARGET): $(HOST_OBJECTS) cannam@10: $(CXX) $(LDFLAGS) $(HOST_LDFLAGS) -o $@ $^ $(HOST_LIBS) cannam@10: cannam@10: test: $(HOST_TARGET) $(PLUGIN_TARGET) cannam@10: $(HOST_TARGET) $(PLUGIN_TARGET) cannam@10: cannam@10: clean: cannam@10: rm -f $(PLUGIN_OBJECTS) $(HOST_OBJECTS) cannam@10: cannam@10: distclean: clean cannam@10: rm -f $(PLUGIN_TARGET) $(HOST_TARGET) *~ */*~ cannam@10: cannam@10: