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@11
|
15 #
|
cannam@10
|
16 CXXFLAGS := $(CXXFLAGS) -O2 -Wall -I$(SDKDIR) -I$(APIDIR) -I.
|
cannam@1
|
17
|
cannam@10
|
18 # Libraries required for the host at link time
|
cannam@11
|
19 #
|
cannam@11
|
20 HOST_LIBS = -Lvamp-sdk -lvamp-sdk -ldl
|
cannam@0
|
21
|
cannam@10
|
22 # Libraries required for the plugin. Note that we can (and actively
|
cannam@10
|
23 # want to) statically link with libstdc++, because our plugin exposes
|
cannam@10
|
24 # a C API so there are no boundary compatibility problems.
|
cannam@11
|
25 #
|
cannam@11
|
26 PLUGIN_LIBS = -Lvamp-sdk -lvamp-sdk
|
cannam@11
|
27 #PLUGIN_LIBS = -lvamp-sdk $(shell g++ -print-file-name=libstdc++.a)
|
cannam@0
|
28
|
cannam@10
|
29 # Flags required to tell the compiler to link to a dynamically loadable object
|
cannam@11
|
30 #
|
cannam@10
|
31 PLUGIN_LDFLAGS = -shared -Wl,-Bsymbolic -static-libgcc
|
cannam@10
|
32
|
cannam@10
|
33 # File extension for a dynamically loadable object
|
cannam@11
|
34 #
|
cannam@10
|
35 PLUGIN_EXT = .so
|
cannam@10
|
36
|
cannam@10
|
37 ## For OS/X with g++:
|
cannam@10
|
38 #PLUGIN_LDFLAGS = -dynamiclib
|
cannam@10
|
39 #PLUGIN_EXT = .dylib
|
cannam@10
|
40
|
cannam@10
|
41 ### End of user-serviceable parts
|
cannam@10
|
42
|
cannam@11
|
43 SDK_OBJECTS = \
|
cannam@11
|
44 $(SDKDIR)/PluginAdapter.o \
|
cannam@11
|
45 $(SDKDIR)/PluginHostAdapter.o \
|
cannam@11
|
46 $(SDKDIR)/RealTime.o
|
cannam@11
|
47
|
cannam@11
|
48 SDK_TARGET = \
|
cannam@11
|
49 $(SDKDIR)/libvamp-sdk.a
|
cannam@10
|
50
|
cannam@10
|
51 PLUGIN_OBJECTS = \
|
cannam@10
|
52 $(EXAMPLEDIR)/ZeroCrossing.o \
|
cannam@10
|
53 $(EXAMPLEDIR)/SpectralCentroid.o \
|
cannam@10
|
54 $(EXAMPLEDIR)/plugins.o
|
cannam@10
|
55
|
cannam@10
|
56 PLUGIN_TARGET = \
|
cannam@10
|
57 $(EXAMPLEDIR)/plugins$(PLUGIN_EXT)
|
cannam@10
|
58
|
cannam@10
|
59 HOST_OBJECTS = \
|
cannam@10
|
60 $(HOSTDIR)/simplehost.o
|
cannam@10
|
61
|
cannam@10
|
62 HOST_TARGET = \
|
cannam@10
|
63 $(HOSTDIR)/simplehost
|
cannam@10
|
64
|
cannam@11
|
65 all: $(SDK_TARGET) $(PLUGIN_TARGET) $(HOST_TARGET) test
|
cannam@11
|
66
|
cannam@11
|
67 $(SDK_TARGET): $(SDK_OBJECTS)
|
cannam@11
|
68 $(AR) r $@ $^
|
cannam@10
|
69
|
cannam@12
|
70 $(PLUGIN_TARGET): $(PLUGIN_OBJECTS) $(SDK_TARGET)
|
cannam@10
|
71 $(CXX) $(LDFLAGS) $(PLUGIN_LDFLAGS) -o $@ $^ $(PLUGIN_LIBS)
|
cannam@10
|
72
|
cannam@12
|
73 $(HOST_TARGET): $(HOST_OBJECTS) $(SDK_TARGET)
|
cannam@10
|
74 $(CXX) $(LDFLAGS) $(HOST_LDFLAGS) -o $@ $^ $(HOST_LIBS)
|
cannam@10
|
75
|
cannam@10
|
76 test: $(HOST_TARGET) $(PLUGIN_TARGET)
|
cannam@10
|
77 $(HOST_TARGET) $(PLUGIN_TARGET)
|
cannam@10
|
78
|
cannam@10
|
79 clean:
|
cannam@11
|
80 rm -f $(SDK_OBJECTS) $(PLUGIN_OBJECTS) $(HOST_OBJECTS)
|
cannam@10
|
81
|
cannam@10
|
82 distclean: clean
|
cannam@11
|
83 rm -f $(SDK_TARGET) $(PLUGIN_TARGET) $(HOST_TARGET) *~ */*~
|
cannam@10
|
84
|
cannam@10
|
85
|