annotate Makefile @ 10:83d3eb580731

* Use a single Makefile
author cannam
date Thu, 06 Apr 2006 12:01:07 +0000
parents c66551966b5f
children 6616075ec7b6
rev   line source
cannam@0 1
cannam@10 2 # Makefile for the Vamp plugin SDK. This builds the SDK objects,
cannam@10 3 # example plugins, and the test host. Please adjust to suit your
cannam@10 4 # operating system requirements.
cannam@0 5
cannam@10 6 SDKDIR = vamp-sdk
cannam@10 7 APIDIR = vamp
cannam@10 8 EXAMPLEDIR = examples
cannam@10 9 HOSTDIR = host
cannam@1 10
cannam@0 11
cannam@10 12 ### Start of user-serviceable parts
cannam@1 13
cannam@10 14 # Compile flags
cannam@10 15 CXXFLAGS := $(CXXFLAGS) -O2 -Wall -I$(SDKDIR) -I$(APIDIR) -I.
cannam@1 16
cannam@10 17 # Libraries required for the host at link time
cannam@10 18 HOST_LIBS = -ldl
cannam@0 19
cannam@10 20 # Libraries required for the plugin. Note that we can (and actively
cannam@10 21 # want to) statically link with libstdc++, because our plugin exposes
cannam@10 22 # a C API so there are no boundary compatibility problems.
cannam@10 23 #PLUGIN_LIBS = $(shell g++ -print-file-name=libstdc++.a)
cannam@0 24
cannam@10 25 # Flags required to tell the compiler to link to a dynamically loadable object
cannam@10 26 PLUGIN_LDFLAGS = -shared -Wl,-Bsymbolic -static-libgcc
cannam@10 27
cannam@10 28 # File extension for a dynamically loadable object
cannam@10 29 PLUGIN_EXT = .so
cannam@10 30
cannam@10 31 ## For OS/X with g++:
cannam@10 32 #PLUGIN_LDFLAGS = -dynamiclib
cannam@10 33 #PLUGIN_EXT = .dylib
cannam@10 34
cannam@10 35 ### End of user-serviceable parts
cannam@10 36
cannam@10 37
cannam@10 38 PLUGIN_OBJECTS = \
cannam@10 39 $(SDKDIR)/PluginAdapter.o \
cannam@10 40 $(SDKDIR)/PluginHostAdapter.o \
cannam@10 41 $(SDKDIR)/RealTime.o \
cannam@10 42 $(EXAMPLEDIR)/ZeroCrossing.o \
cannam@10 43 $(EXAMPLEDIR)/SpectralCentroid.o \
cannam@10 44 $(EXAMPLEDIR)/plugins.o
cannam@10 45
cannam@10 46 PLUGIN_TARGET = \
cannam@10 47 $(EXAMPLEDIR)/plugins$(PLUGIN_EXT)
cannam@10 48
cannam@10 49 HOST_OBJECTS = \
cannam@10 50 $(SDKDIR)/PluginAdapter.o \
cannam@10 51 $(SDKDIR)/PluginHostAdapter.o \
cannam@10 52 $(SDKDIR)/RealTime.o \
cannam@10 53 $(HOSTDIR)/simplehost.o
cannam@10 54
cannam@10 55 HOST_TARGET = \
cannam@10 56 $(HOSTDIR)/simplehost
cannam@10 57
cannam@10 58 all: $(PLUGIN_TARGET) $(HOST_TARGET) test
cannam@10 59
cannam@10 60 $(PLUGIN_TARGET): $(PLUGIN_OBJECTS)
cannam@10 61 $(CXX) $(LDFLAGS) $(PLUGIN_LDFLAGS) -o $@ $^ $(PLUGIN_LIBS)
cannam@10 62
cannam@10 63 $(HOST_TARGET): $(HOST_OBJECTS)
cannam@10 64 $(CXX) $(LDFLAGS) $(HOST_LDFLAGS) -o $@ $^ $(HOST_LIBS)
cannam@10 65
cannam@10 66 test: $(HOST_TARGET) $(PLUGIN_TARGET)
cannam@10 67 $(HOST_TARGET) $(PLUGIN_TARGET)
cannam@10 68
cannam@10 69 clean:
cannam@10 70 rm -f $(PLUGIN_OBJECTS) $(HOST_OBJECTS)
cannam@10 71
cannam@10 72 distclean: clean
cannam@10 73 rm -f $(PLUGIN_TARGET) $(HOST_TARGET) *~ */*~
cannam@10 74
cannam@10 75