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@16
|
20 HOST_LIBS = -Lvamp-sdk -lvamp-sdk -lsndfile -ldl
|
cannam@0
|
21
|
cannam@10
|
22 # Libraries required for the plugin. Note that we can (and actively
|
cannam@18
|
23 # want to) statically link libstdc++, because our plugin exposes only
|
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@18
|
27 #PLUGIN_LIBS = -Lvamp-sdk -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@20
|
43 API_HEADERS = \
|
cannam@20
|
44 $(APIDIR)/vamp.h
|
cannam@20
|
45
|
cannam@20
|
46 SDK_HEADERS = \
|
cannam@20
|
47 $(SDKDIR)/Plugin.h \
|
cannam@20
|
48 $(SDKDIR)/PluginAdapter.h \
|
cannam@20
|
49 $(SDKDIR)/PluginBase.h \
|
cannam@20
|
50 $(SDKDIR)/PluginHostAdapter.h \
|
cannam@20
|
51 $(SDKDIR)/RealTime.h
|
cannam@20
|
52
|
cannam@11
|
53 SDK_OBJECTS = \
|
cannam@11
|
54 $(SDKDIR)/PluginAdapter.o \
|
cannam@11
|
55 $(SDKDIR)/PluginHostAdapter.o \
|
cannam@11
|
56 $(SDKDIR)/RealTime.o
|
cannam@11
|
57
|
cannam@11
|
58 SDK_TARGET = \
|
cannam@11
|
59 $(SDKDIR)/libvamp-sdk.a
|
cannam@10
|
60
|
cannam@20
|
61 PLUGIN_HEADERS = \
|
cannam@20
|
62 $(EXAMPLEDIR)/SpectralCentroid.h \
|
cannam@20
|
63 $(EXAMPLEDIR)/ZeroCrossing.h
|
cannam@20
|
64
|
cannam@10
|
65 PLUGIN_OBJECTS = \
|
cannam@20
|
66 $(EXAMPLEDIR)/SpectralCentroid.o \
|
cannam@10
|
67 $(EXAMPLEDIR)/ZeroCrossing.o \
|
cannam@10
|
68 $(EXAMPLEDIR)/plugins.o
|
cannam@10
|
69
|
cannam@10
|
70 PLUGIN_TARGET = \
|
cannam@10
|
71 $(EXAMPLEDIR)/plugins$(PLUGIN_EXT)
|
cannam@10
|
72
|
cannam@20
|
73 HOST_HEADERS = \
|
cannam@20
|
74 $(HOSTDIR)/system.h
|
cannam@20
|
75
|
cannam@10
|
76 HOST_OBJECTS = \
|
cannam@10
|
77 $(HOSTDIR)/simplehost.o
|
cannam@10
|
78
|
cannam@10
|
79 HOST_TARGET = \
|
cannam@10
|
80 $(HOSTDIR)/simplehost
|
cannam@10
|
81
|
cannam@11
|
82 all: $(SDK_TARGET) $(PLUGIN_TARGET) $(HOST_TARGET) test
|
cannam@11
|
83
|
cannam@20
|
84 $(SDK_TARGET): $(SDK_OBJECTS) $(API_HEADERS) $(SDK_HEADERS)
|
cannam@20
|
85 $(AR) r $@ $(SDK_OBJECTS)
|
cannam@10
|
86
|
cannam@20
|
87 $(PLUGIN_TARGET): $(PLUGIN_OBJECTS) $(SDK_TARGET) $(PLUGIN_HEADERS)
|
cannam@20
|
88 $(CXX) $(LDFLAGS) $(PLUGIN_LDFLAGS) -o $@ $(PLUGIN_OBJECTS) $(PLUGIN_LIBS)
|
cannam@10
|
89
|
cannam@20
|
90 $(HOST_TARGET): $(HOST_OBJECTS) $(SDK_TARGET) $(HOST_HEADERS)
|
cannam@20
|
91 $(CXX) $(LDFLAGS) $(HOST_LDFLAGS) -o $@ $(HOST_OBJECTS) $(HOST_LIBS)
|
cannam@10
|
92
|
cannam@10
|
93 test: $(HOST_TARGET) $(PLUGIN_TARGET)
|
cannam@10
|
94 $(HOST_TARGET) $(PLUGIN_TARGET)
|
cannam@10
|
95
|
cannam@10
|
96 clean:
|
cannam@11
|
97 rm -f $(SDK_OBJECTS) $(PLUGIN_OBJECTS) $(HOST_OBJECTS)
|
cannam@10
|
98
|
cannam@10
|
99 distclean: clean
|
cannam@11
|
100 rm -f $(SDK_TARGET) $(PLUGIN_TARGET) $(HOST_TARGET) *~ */*~
|
cannam@10
|
101
|
cannam@10
|
102
|