cannam@94
|
1
|
cannam@94
|
2 # Makefile for the Vamp plugin SDK. This builds the SDK objects,
|
cannam@94
|
3 # libraries, example plugins, and the test host. Please adjust to
|
cannam@94
|
4 # suit your operating system requirements.
|
cannam@94
|
5 #
|
cannam@94
|
6 # This version of the Makefile is approximately correct for OS/X.
|
cannam@94
|
7 # Note that it has no "install" target; the following are the
|
cannam@94
|
8 # library and related files that may be of interest resulting from
|
cannam@94
|
9 # the build:
|
cannam@94
|
10 #
|
cannam@94
|
11 # vamp-sdk/libvamp-sdk.dylib [SDK dynamic library for plugins]
|
cannam@94
|
12 # vamp-sdk/libvamp-hostsdk.dylib [SDK dynamic library for hosts]
|
cannam@94
|
13 #
|
cannam@94
|
14 # vamp-sdk/libvamp-sdk.a [SDK static library for plugins]
|
cannam@94
|
15 # vamp-sdk/libvamp-hostsdk.a [SDK static library for hosts]
|
cannam@94
|
16 #
|
cannam@94
|
17 # examples/vamp-example-plugins.cat [copy this to your Vamp plugin dir]
|
cannam@94
|
18 # examples/vamp-example-plugins.dylib [copy this to your Vamp plugin dir]
|
cannam@94
|
19 #
|
cannam@94
|
20 # host/vamp-simple-host [requires libsndfile to build]
|
cannam@94
|
21
|
cannam@94
|
22 APIDIR = vamp
|
cannam@94
|
23 SDKDIR = vamp-sdk
|
cannam@94
|
24 HOSTEXTDIR = vamp-sdk/hostext
|
cannam@94
|
25 EXAMPLEDIR = examples
|
cannam@94
|
26 HOSTDIR = host
|
cannam@94
|
27
|
cannam@94
|
28 ###
|
cannam@94
|
29 ### Start of user-serviceable parts
|
cannam@94
|
30 ###
|
cannam@94
|
31
|
cannam@94
|
32 # Default build target (or use "make <target>" to select one).
|
cannam@94
|
33 # Targets are:
|
cannam@94
|
34 # all -- build everything
|
cannam@94
|
35 # sdk -- build all the Vamp SDK libraries for plugins and hosts
|
cannam@94
|
36 # sdkstatic -- build only the static versions of the SDK libraries
|
cannam@94
|
37 # plugins -- build the example plugins (and the SDK if required)
|
cannam@94
|
38 # host -- build the simple Vamp plugin host (and the SDK if required)
|
cannam@94
|
39 # test -- build the host and example plugins, and run a quick test
|
cannam@94
|
40 # clean -- remove binary targets
|
cannam@94
|
41 # distclean -- remove all targets
|
cannam@94
|
42 #
|
cannam@94
|
43 default: all
|
cannam@94
|
44
|
cannam@94
|
45 # Compile flags
|
cannam@94
|
46 #
|
cannam@163
|
47 CXXFLAGS := $(CXXFLAGS) -O2 -Wall -I. -fPIC
|
cannam@94
|
48
|
cannam@94
|
49 # ar, ranlib
|
cannam@94
|
50 #
|
cannam@94
|
51 AR := ar
|
cannam@94
|
52 RANLIB := ranlib
|
cannam@94
|
53
|
cannam@94
|
54 # Libraries required for the plugins.
|
cannam@94
|
55 # (Note that it is desirable to statically link libstdc++ if possible,
|
cannam@94
|
56 # because our plugin exposes only a C API so there are no boundary
|
cannam@94
|
57 # compatibility problems.)
|
cannam@94
|
58 #
|
cannam@94
|
59 PLUGIN_LIBS = $(SDKDIR)/libvamp-sdk.a
|
cannam@94
|
60
|
cannam@94
|
61 # File extension for a dynamically loadable object
|
cannam@94
|
62 #
|
cannam@94
|
63 PLUGIN_EXT = .dylib
|
cannam@94
|
64
|
cannam@94
|
65 # Libraries required for the host.
|
cannam@94
|
66 #
|
cannam@163
|
67 HOST_LIBS = $(SDKDIR)/libvamp-hostsdk.a -lsndfile -ldl
|
cannam@94
|
68
|
cannam@94
|
69 # Flags required to tell the compiler to create a dynamically loadable object
|
cannam@94
|
70 #
|
cannam@163
|
71 DYNAMIC_LDFLAGS = -dynamiclib
|
cannam@128
|
72 PLUGIN_LDFLAGS = $(DYNAMIC_LDFLAGS) -install_name vamp-example-plugins.dylib
|
cannam@128
|
73 SDK_DYNAMIC_LDFLAGS = $(DYNAMIC_LDFLAGS) -install_name libvamp-sdk.dylib
|
cannam@128
|
74 HOSTSDK_DYNAMIC_LDFLAGS = $(DYNAMIC_LDFLAGS) -install_name libvamp-hostsdk.dylib
|
cannam@94
|
75
|
cannam@94
|
76
|
cannam@94
|
77 ### End of user-serviceable parts
|
cannam@94
|
78
|
cannam@94
|
79
|
cannam@94
|
80 API_HEADERS = \
|
cannam@94
|
81 $(APIDIR)/vamp.h
|
cannam@94
|
82
|
cannam@94
|
83 SDK_HEADERS = \
|
cannam@94
|
84 $(SDKDIR)/Plugin.h \
|
cannam@94
|
85 $(SDKDIR)/PluginAdapter.h \
|
cannam@94
|
86 $(SDKDIR)/PluginBase.h \
|
cannam@94
|
87 $(SDKDIR)/RealTime.h
|
cannam@94
|
88
|
cannam@94
|
89 HOSTSDK_HEADERS = \
|
cannam@94
|
90 $(SDKDIR)/Plugin.h \
|
cannam@94
|
91 $(SDKDIR)/PluginBase.h \
|
cannam@94
|
92 $(SDKDIR)/PluginHostAdapter.h \
|
cannam@94
|
93 $(SDKDIR)/RealTime.h
|
cannam@94
|
94
|
cannam@94
|
95 HOSTEXT_HEADERS = \
|
cannam@94
|
96 $(HOSTEXTDIR)/PluginBufferingAdapter.h \
|
cannam@94
|
97 $(HOSTEXTDIR)/PluginChannelAdapter.h \
|
cannam@94
|
98 $(HOSTEXTDIR)/PluginInputDomainAdapter.h \
|
cannam@94
|
99 $(HOSTEXTDIR)/PluginLoader.h \
|
cannam@94
|
100 $(HOSTEXTDIR)/PluginWrapper.h
|
cannam@94
|
101
|
cannam@94
|
102 SDK_OBJECTS = \
|
cannam@94
|
103 $(SDKDIR)/PluginAdapter.o \
|
cannam@94
|
104 $(SDKDIR)/RealTime.o
|
cannam@94
|
105
|
cannam@94
|
106 HOSTSDK_OBJECTS = \
|
cannam@94
|
107 $(SDKDIR)/PluginHostAdapter.o \
|
cannam@94
|
108 $(HOSTEXTDIR)/PluginBufferingAdapter.o \
|
cannam@94
|
109 $(HOSTEXTDIR)/PluginChannelAdapter.o \
|
cannam@94
|
110 $(HOSTEXTDIR)/PluginInputDomainAdapter.o \
|
cannam@94
|
111 $(HOSTEXTDIR)/PluginLoader.o \
|
cannam@94
|
112 $(HOSTEXTDIR)/PluginWrapper.o \
|
cannam@94
|
113 $(SDKDIR)/RealTime.o
|
cannam@94
|
114
|
cannam@94
|
115 SDK_STATIC = \
|
cannam@94
|
116 $(SDKDIR)/libvamp-sdk.a
|
cannam@94
|
117
|
cannam@94
|
118 HOSTSDK_STATIC = \
|
cannam@94
|
119 $(SDKDIR)/libvamp-hostsdk.a
|
cannam@94
|
120
|
cannam@94
|
121 SDK_DYNAMIC = \
|
cannam@94
|
122 $(SDKDIR)/libvamp-sdk$(PLUGIN_EXT)
|
cannam@94
|
123
|
cannam@94
|
124 HOSTSDK_DYNAMIC = \
|
cannam@94
|
125 $(SDKDIR)/libvamp-hostsdk$(PLUGIN_EXT)
|
cannam@94
|
126
|
cannam@94
|
127 SDK_LA = \
|
cannam@94
|
128 $(SDKDIR)/libvamp-sdk.la
|
cannam@94
|
129
|
cannam@94
|
130 HOSTSDK_LA = \
|
cannam@94
|
131 $(SDKDIR)/libvamp-hostsdk.la
|
cannam@94
|
132
|
cannam@94
|
133 PLUGIN_HEADERS = \
|
cannam@94
|
134 $(EXAMPLEDIR)/SpectralCentroid.h \
|
cannam@94
|
135 $(EXAMPLEDIR)/PercussionOnsetDetector.h \
|
cannam@94
|
136 $(EXAMPLEDIR)/AmplitudeFollower.h \
|
cannam@94
|
137 $(EXAMPLEDIR)/ZeroCrossing.h
|
cannam@94
|
138
|
cannam@94
|
139 PLUGIN_OBJECTS = \
|
cannam@94
|
140 $(EXAMPLEDIR)/SpectralCentroid.o \
|
cannam@94
|
141 $(EXAMPLEDIR)/PercussionOnsetDetector.o \
|
cannam@94
|
142 $(EXAMPLEDIR)/AmplitudeFollower.o \
|
cannam@94
|
143 $(EXAMPLEDIR)/ZeroCrossing.o \
|
cannam@94
|
144 $(EXAMPLEDIR)/plugins.o
|
cannam@94
|
145
|
cannam@94
|
146 PLUGIN_TARGET = \
|
cannam@94
|
147 $(EXAMPLEDIR)/vamp-example-plugins$(PLUGIN_EXT)
|
cannam@94
|
148
|
cannam@94
|
149 HOST_HEADERS = \
|
cannam@94
|
150 $(HOSTDIR)/system.h
|
cannam@94
|
151
|
cannam@94
|
152 HOST_OBJECTS = \
|
cannam@94
|
153 $(HOSTDIR)/vamp-simple-host.o
|
cannam@94
|
154
|
cannam@94
|
155 HOST_TARGET = \
|
cannam@94
|
156 $(HOSTDIR)/vamp-simple-host
|
cannam@94
|
157
|
cannam@94
|
158 sdk: sdkstatic $(SDK_DYNAMIC) $(HOSTSDK_DYNAMIC)
|
cannam@94
|
159
|
cannam@94
|
160 sdkstatic: $(SDK_STATIC) $(HOSTSDK_STATIC)
|
cannam@94
|
161 $(RANLIB) $(SDK_STATIC)
|
cannam@94
|
162 $(RANLIB) $(HOSTSDK_STATIC)
|
cannam@94
|
163
|
cannam@94
|
164 plugins: $(PLUGIN_TARGET)
|
cannam@94
|
165
|
cannam@94
|
166 host: $(HOST_TARGET)
|
cannam@94
|
167
|
cannam@94
|
168 all: sdk plugins host test
|
cannam@94
|
169
|
cannam@94
|
170 $(SDK_STATIC): $(SDK_OBJECTS) $(API_HEADERS) $(SDK_HEADERS)
|
cannam@94
|
171 $(AR) r $@ $(SDK_OBJECTS)
|
cannam@94
|
172
|
cannam@94
|
173 $(HOSTSDK_STATIC): $(HOSTSDK_OBJECTS) $(API_HEADERS) $(HOSTSDK_HEADERS) $(HOSTEXT_HEADERS)
|
cannam@94
|
174 $(AR) r $@ $(HOSTSDK_OBJECTS)
|
cannam@94
|
175
|
cannam@94
|
176 $(SDK_DYNAMIC): $(SDK_OBJECTS) $(API_HEADERS) $(SDK_HEADERS)
|
cannam@94
|
177 $(CXX) $(LDFLAGS) $(SDK_DYNAMIC_LDFLAGS) -o $@ $(SDK_OBJECTS)
|
cannam@94
|
178
|
cannam@94
|
179 $(HOSTSDK_DYNAMIC): $(HOSTSDK_OBJECTS) $(API_HEADERS) $(HOSTSDK_HEADERS) $(HOSTEXT_HEADERS)
|
cannam@94
|
180 $(CXX) $(LDFLAGS) $(HOSTSDK_DYNAMIC_LDFLAGS) -o $@ $(HOSTSDK_OBJECTS)
|
cannam@94
|
181
|
cannam@94
|
182 $(PLUGIN_TARGET): $(PLUGIN_OBJECTS) $(SDK_STATIC) $(PLUGIN_HEADERS)
|
cannam@94
|
183 $(CXX) $(LDFLAGS) $(PLUGIN_LDFLAGS) -o $@ $(PLUGIN_OBJECTS) $(PLUGIN_LIBS)
|
cannam@94
|
184
|
cannam@94
|
185 $(HOST_TARGET): $(HOST_OBJECTS) $(HOSTSDK_STATIC) $(HOST_HEADERS)
|
cannam@94
|
186 $(CXX) $(LDFLAGS) $(HOST_LDFLAGS) -o $@ $(HOST_OBJECTS) $(HOST_LIBS)
|
cannam@94
|
187
|
cannam@94
|
188 test: plugins host
|
cannam@94
|
189 VAMP_PATH=$(EXAMPLEDIR) $(HOST_TARGET) -l
|
cannam@94
|
190
|
cannam@94
|
191 clean:
|
cannam@94
|
192 rm -f $(SDK_OBJECTS) $(HOSTSDK_OBJECTS) $(PLUGIN_OBJECTS) $(HOST_OBJECTS)
|
cannam@94
|
193
|
cannam@94
|
194 distclean: clean
|
cannam@94
|
195 rm -f $(SDK_STATIC) $(SDK_DYNAMIC) $(HOSTSDK_STATIC) $(HOSTSDK_DYNAMIC) $(PLUGIN_TARGET) $(HOST_TARGET) *~ */*~
|
cannam@94
|
196
|