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@11: # cannam@10: CXXFLAGS := $(CXXFLAGS) -O2 -Wall -I$(SDKDIR) -I$(APIDIR) -I. cannam@1: cannam@10: # Libraries required for the host at link time cannam@11: # cannam@11: HOST_LIBS = -Lvamp-sdk -lvamp-sdk -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@11: # cannam@11: PLUGIN_LIBS = -Lvamp-sdk -lvamp-sdk cannam@11: #PLUGIN_LIBS = -lvamp-sdk $(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@11: # cannam@10: PLUGIN_LDFLAGS = -shared -Wl,-Bsymbolic -static-libgcc cannam@10: cannam@10: # File extension for a dynamically loadable object cannam@11: # 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@11: SDK_OBJECTS = \ cannam@11: $(SDKDIR)/PluginAdapter.o \ cannam@11: $(SDKDIR)/PluginHostAdapter.o \ cannam@11: $(SDKDIR)/RealTime.o cannam@11: cannam@11: SDK_TARGET = \ cannam@11: $(SDKDIR)/libvamp-sdk.a cannam@10: cannam@10: PLUGIN_OBJECTS = \ 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: $(HOSTDIR)/simplehost.o cannam@10: cannam@10: HOST_TARGET = \ cannam@10: $(HOSTDIR)/simplehost cannam@10: cannam@11: all: $(SDK_TARGET) $(PLUGIN_TARGET) $(HOST_TARGET) test cannam@11: cannam@11: $(SDK_TARGET): $(SDK_OBJECTS) cannam@11: $(AR) r $@ $^ 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@11: rm -f $(SDK_OBJECTS) $(PLUGIN_OBJECTS) $(HOST_OBJECTS) cannam@10: cannam@10: distclean: clean cannam@11: rm -f $(SDK_TARGET) $(PLUGIN_TARGET) $(HOST_TARGET) *~ */*~ cannam@10: cannam@10: