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@22: CXXFLAGS := $(CXXFLAGS) -g -Wall -I$(SDKDIR) -I$(APIDIR) -I. cannam@1: cannam@10: # Libraries required for the host at link time cannam@11: # cannam@16: HOST_LIBS = -Lvamp-sdk -lvamp-sdk -lsndfile -ldl cannam@0: cannam@10: # Libraries required for the plugin. Note that we can (and actively cannam@18: # want to) statically link libstdc++, because our plugin exposes only cannam@10: # a C API so there are no boundary compatibility problems. cannam@11: # cannam@11: PLUGIN_LIBS = -Lvamp-sdk -lvamp-sdk cannam@18: #PLUGIN_LIBS = -Lvamp-sdk -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@20: API_HEADERS = \ cannam@20: $(APIDIR)/vamp.h cannam@20: cannam@20: SDK_HEADERS = \ cannam@20: $(SDKDIR)/Plugin.h \ cannam@20: $(SDKDIR)/PluginAdapter.h \ cannam@20: $(SDKDIR)/PluginBase.h \ cannam@20: $(SDKDIR)/PluginHostAdapter.h \ cannam@20: $(SDKDIR)/RealTime.h cannam@20: 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@20: PLUGIN_HEADERS = \ cannam@20: $(EXAMPLEDIR)/SpectralCentroid.h \ cannam@20: $(EXAMPLEDIR)/ZeroCrossing.h cannam@20: cannam@10: PLUGIN_OBJECTS = \ cannam@20: $(EXAMPLEDIR)/SpectralCentroid.o \ cannam@10: $(EXAMPLEDIR)/ZeroCrossing.o \ cannam@10: $(EXAMPLEDIR)/plugins.o cannam@10: cannam@10: PLUGIN_TARGET = \ cannam@21: $(EXAMPLEDIR)/vamp-example-plugins$(PLUGIN_EXT) cannam@10: cannam@20: HOST_HEADERS = \ cannam@20: $(HOSTDIR)/system.h cannam@20: cannam@10: HOST_OBJECTS = \ cannam@22: $(HOSTDIR)/vamp-simple-host.o cannam@10: cannam@10: HOST_TARGET = \ cannam@22: $(HOSTDIR)/vamp-simple-host cannam@10: cannam@11: all: $(SDK_TARGET) $(PLUGIN_TARGET) $(HOST_TARGET) test cannam@11: cannam@20: $(SDK_TARGET): $(SDK_OBJECTS) $(API_HEADERS) $(SDK_HEADERS) cannam@20: $(AR) r $@ $(SDK_OBJECTS) cannam@10: cannam@20: $(PLUGIN_TARGET): $(PLUGIN_OBJECTS) $(SDK_TARGET) $(PLUGIN_HEADERS) cannam@20: $(CXX) $(LDFLAGS) $(PLUGIN_LDFLAGS) -o $@ $(PLUGIN_OBJECTS) $(PLUGIN_LIBS) cannam@10: cannam@20: $(HOST_TARGET): $(HOST_OBJECTS) $(SDK_TARGET) $(HOST_HEADERS) cannam@20: $(CXX) $(LDFLAGS) $(HOST_LDFLAGS) -o $@ $(HOST_OBJECTS) $(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: