comparison Makefile @ 64:9d3272c7db60

* Merge from host-factory-stuff branch: this adds several helper classes in the hostext directory that should make a host's life much easier. This will become version 1.1 of the SDK, eventually.
author cannam
date Fri, 01 Jun 2007 15:10:17 +0000
parents 2403ae53b8a5
children ba5f87117b67
comparison
equal deleted inserted replaced
54:933fee59d33a 64:9d3272c7db60
1 1
2 # Makefile for the Vamp plugin SDK. This builds the SDK objects, 2 # Makefile for the Vamp plugin SDK. This builds the SDK objects,
3 # libraries, example plugins, and the test host. Please adjust to 3 # libraries, example plugins, and the test host. Please adjust to
4 # suit your operating system requirements. 4 # suit your operating system requirements.
5 5
6 APIDIR = vamp
6 SDKDIR = vamp-sdk 7 SDKDIR = vamp-sdk
7 APIDIR = vamp 8 HOSTEXTDIR = vamp-sdk/hostext
8 EXAMPLEDIR = examples 9 EXAMPLEDIR = examples
9 HOSTDIR = host 10 HOSTDIR = host
10 11
11 12 ###
12 ### Start of user-serviceable parts 13 ### Start of user-serviceable parts
14 ###
15
16 # Default build target (or use "make <target>" to select one).
17 # Targets are:
18 # all -- build everything
19 # sdk -- build all the Vamp SDK libraries for plugins and hosts
20 # plugins -- build the example plugins (and the SDK if required)
21 # host -- build the simple Vamp plugin host (and the SDK if required)
22 # test -- build the host and example plugins, and run a quick test
23 # clean -- remove binary targets
24 # distclean -- remove all targets
25 #
26 default: all
27
28 # Compile flags
29 #
30 CXXFLAGS := $(CXXFLAGS) -g -Wall -I.
31
32 # Libraries required for the plugins.
33 # (Note that it is desirable to statically link libstdc++ if possible,
34 # because our plugin exposes only a C API so there are no boundary
35 # compatibility problems.)
36 #
37 PLUGIN_LIBS = $(SDKDIR)/libvamp-sdk.a
38 #PLUGIN_LIBS = vamp-sdk/libvamp-sdk.a $(shell g++ -print-file-name=libstdc++.a)
39
40 # Flags required to tell the compiler to link to a dynamically loadable object
41 #
42 PLUGIN_LDFLAGS = -shared -Wl,-Bsymbolic -static-libgcc
43
44 # File extension for a dynamically loadable object
45 #
46 PLUGIN_EXT = .so
47
48 ## For OS/X with g++:
49 #PLUGIN_LDFLAGS = -dynamiclib
50 #PLUGIN_EXT = .dylib
51
52 # Libraries required for the host.
53 #
54 HOST_LIBS = $(SDKDIR)/libvamp-hostsdk.a -lsndfile -ldl
13 55
14 # Locations for "make install". This will need quite a bit of 56 # Locations for "make install". This will need quite a bit of
15 # editing for non-Linux platforms. Of course you don't necessarily 57 # editing for non-Linux platforms. Of course you don't necessarily
16 # have to use "make install". 58 # have to use "make install".
17 # 59 #
18 INSTALL_PREFIX := /usr/local 60 INSTALL_PREFIX := /usr/local
19 INSTALL_API_HEADERS := $(INSTALL_PREFIX)/include/vamp 61 INSTALL_API_HEADERS := $(INSTALL_PREFIX)/include/vamp
20 INSTALL_SDK_HEADERS := $(INSTALL_PREFIX)/include/vamp-sdk 62 INSTALL_SDK_HEADERS := $(INSTALL_PREFIX)/include/vamp-sdk
63 INSTALL_HOSTEXT_HEADERS := $(INSTALL_PREFIX)/include/vamp-sdk/hostext
21 INSTALL_SDK_LIBS := $(INSTALL_PREFIX)/lib 64 INSTALL_SDK_LIBS := $(INSTALL_PREFIX)/lib
22 65
23 INSTALL_SDK_LIBNAME := libvamp-sdk.so.1.0.0 66 INSTALL_SDK_LIBNAME := libvamp-sdk.so.1.0.0
24 INSTALL_SDK_LINK_ABI := libvamp-sdk.so.1 67 INSTALL_SDK_LINK_ABI := libvamp-sdk.so.1
25 INSTALL_SDK_LINK_DEV := libvamp-sdk.so 68 INSTALL_SDK_LINK_DEV := libvamp-sdk.so
32 INSTALL_HOSTSDK_STATIC := libvamp-hostsdk.a 75 INSTALL_HOSTSDK_STATIC := libvamp-hostsdk.a
33 INSTALL_HOSTSDK_LA := libvamp-hostsdk.la 76 INSTALL_HOSTSDK_LA := libvamp-hostsdk.la
34 77
35 INSTALL_PKGCONFIG := $(INSTALL_PREFIX)/lib/pkgconfig 78 INSTALL_PKGCONFIG := $(INSTALL_PREFIX)/lib/pkgconfig
36 79
37 # Compile flags
38 #
39 CXXFLAGS := $(CXXFLAGS) -O2 -Wall -I$(SDKDIR) -I$(APIDIR) -I.
40
41 # Libraries required for the host at link time
42 #
43 HOST_LIBS = vamp-sdk/libvamp-hostsdk.a -lsndfile -ldl
44
45 # Libraries required for the plugin. Note that we can (and actively
46 # want to) statically link libstdc++, because our plugin exposes only
47 # a C API so there are no boundary compatibility problems.
48 #
49 PLUGIN_LIBS = vamp-sdk/libvamp-sdk.a
50 #PLUGIN_LIBS = vamp-sdk/libvamp-sdk.a $(shell g++ -print-file-name=libstdc++.a)
51
52 # Flags required to tell the compiler to link to a dynamically loadable object
53 #
54 PLUGIN_LDFLAGS = -shared -Wl,-Bsymbolic -static-libgcc
55
56 # File extension for a dynamically loadable object
57 #
58 PLUGIN_EXT = .so
59
60 ## For OS/X with g++:
61 #PLUGIN_LDFLAGS = -dynamiclib
62 #PLUGIN_EXT = .dylib
63
64 ### End of user-serviceable parts 80 ### End of user-serviceable parts
65 81
66 82
67 API_HEADERS = \ 83 API_HEADERS = \
68 $(APIDIR)/vamp.h 84 $(APIDIR)/vamp.h
77 $(SDKDIR)/Plugin.h \ 93 $(SDKDIR)/Plugin.h \
78 $(SDKDIR)/PluginBase.h \ 94 $(SDKDIR)/PluginBase.h \
79 $(SDKDIR)/PluginHostAdapter.h \ 95 $(SDKDIR)/PluginHostAdapter.h \
80 $(SDKDIR)/RealTime.h 96 $(SDKDIR)/RealTime.h
81 97
98 HOSTEXT_HEADERS = \
99 $(HOSTEXTDIR)/PluginChannelAdapter.h \
100 $(HOSTEXTDIR)/PluginInputDomainAdapter.h \
101 $(HOSTEXTDIR)/PluginLoader.h \
102 $(HOSTEXTDIR)/PluginWrapper.h
103
82 SDK_OBJECTS = \ 104 SDK_OBJECTS = \
83 $(SDKDIR)/PluginAdapter.o \ 105 $(SDKDIR)/PluginAdapter.o \
84 $(SDKDIR)/RealTime.o 106 $(SDKDIR)/RealTime.o
85 107
86 HOSTSDK_OBJECTS = \ 108 HOSTSDK_OBJECTS = \
87 $(SDKDIR)/PluginHostAdapter.o \ 109 $(SDKDIR)/PluginHostAdapter.o \
110 $(HOSTEXTDIR)/PluginChannelAdapter.o \
111 $(HOSTEXTDIR)/PluginInputDomainAdapter.o \
112 $(HOSTEXTDIR)/PluginLoader.o \
113 $(HOSTEXTDIR)/PluginWrapper.o \
88 $(SDKDIR)/RealTime.o 114 $(SDKDIR)/RealTime.o
89 115
90 SDK_STATIC = \ 116 SDK_STATIC = \
91 $(SDKDIR)/libvamp-sdk.a 117 $(SDKDIR)/libvamp-sdk.a
92 118
125 $(HOSTDIR)/vamp-simple-host.o 151 $(HOSTDIR)/vamp-simple-host.o
126 152
127 HOST_TARGET = \ 153 HOST_TARGET = \
128 $(HOSTDIR)/vamp-simple-host 154 $(HOSTDIR)/vamp-simple-host
129 155
130 all: $(SDK_STATIC) $(SDK_DYNAMIC) $(HOSTSDK_STATIC) $(HOSTSDK_DYNAMIC) $(PLUGIN_TARGET) $(HOST_TARGET) test 156 sdk: $(SDK_STATIC) $(SDK_DYNAMIC) $(HOSTSDK_STATIC) $(HOSTSDK_DYNAMIC)
157
158 plugins: $(PLUGIN_TARGET)
159
160 host: $(HOST_TARGET)
161
162 all: sdk plugins host test
131 163
132 $(SDK_STATIC): $(SDK_OBJECTS) $(API_HEADERS) $(SDK_HEADERS) 164 $(SDK_STATIC): $(SDK_OBJECTS) $(API_HEADERS) $(SDK_HEADERS)
133 $(AR) r $@ $(SDK_OBJECTS) 165 $(AR) r $@ $(SDK_OBJECTS)
134 166
135 $(HOSTSDK_STATIC): $(HOSTSDK_OBJECTS) $(API_HEADERS) $(HOSTSDK_HEADERS) 167 $(HOSTSDK_STATIC): $(HOSTSDK_OBJECTS) $(API_HEADERS) $(HOSTSDK_HEADERS) $(HOSTEXT_HEADERS)
136 $(AR) r $@ $(HOSTSDK_OBJECTS) 168 $(AR) r $@ $(HOSTSDK_OBJECTS)
137 169
138 $(SDK_DYNAMIC): $(SDK_OBJECTS) $(API_HEADERS) $(SDK_HEADERS) 170 $(SDK_DYNAMIC): $(SDK_OBJECTS) $(API_HEADERS) $(SDK_HEADERS)
139 $(CXX) $(LDFLAGS) $(PLUGIN_LDFLAGS) -o $@ $(SDK_OBJECTS) 171 $(CXX) $(LDFLAGS) $(PLUGIN_LDFLAGS) -o $@ $(SDK_OBJECTS)
140 172
141 $(HOSTSDK_DYNAMIC): $(HOSTSDK_OBJECTS) $(API_HEADERS) $(HOSTSDK_HEADERS) 173 $(HOSTSDK_DYNAMIC): $(HOSTSDK_OBJECTS) $(API_HEADERS) $(HOSTSDK_HEADERS) $(HOSTEXT_HEADERS)
142 $(CXX) $(LDFLAGS) $(PLUGIN_LDFLAGS) -o $@ $(HOSTSDK_OBJECTS) 174 $(CXX) $(LDFLAGS) $(PLUGIN_LDFLAGS) -o $@ $(HOSTSDK_OBJECTS)
143 175
144 $(PLUGIN_TARGET): $(PLUGIN_OBJECTS) $(SDK_TARGET) $(PLUGIN_HEADERS) 176 $(PLUGIN_TARGET): $(PLUGIN_OBJECTS) $(SDK_STATIC) $(PLUGIN_HEADERS)
145 $(CXX) $(LDFLAGS) $(PLUGIN_LDFLAGS) -o $@ $(PLUGIN_OBJECTS) $(PLUGIN_LIBS) 177 $(CXX) $(LDFLAGS) $(PLUGIN_LDFLAGS) -o $@ $(PLUGIN_OBJECTS) $(PLUGIN_LIBS)
146 178
147 $(HOST_TARGET): $(HOST_OBJECTS) $(HOSTSDK_TARGET) $(HOST_HEADERS) 179 $(HOST_TARGET): $(HOST_OBJECTS) $(HOSTSDK_STATIC) $(HOST_HEADERS)
148 $(CXX) $(LDFLAGS) $(HOST_LDFLAGS) -o $@ $(HOST_OBJECTS) $(HOST_LIBS) 180 $(CXX) $(LDFLAGS) $(HOST_LDFLAGS) -o $@ $(HOST_OBJECTS) $(HOST_LIBS)
149 181
150 test: $(HOST_TARGET) $(PLUGIN_TARGET) 182 test: plugins host
151 $(HOST_TARGET) $(PLUGIN_TARGET) 183 VAMP_PATH=$(EXAMPLEDIR) $(HOST_TARGET) -l
152 184
153 clean: 185 clean:
154 rm -f $(SDK_OBJECTS) $(HOSTSDK_OBJECTS) $(PLUGIN_OBJECTS) $(HOST_OBJECTS) 186 rm -f $(SDK_OBJECTS) $(HOSTSDK_OBJECTS) $(PLUGIN_OBJECTS) $(HOST_OBJECTS)
155 187
156 distclean: clean 188 distclean: clean
157 rm -f $(SDK_STATIC) $(SDK_DYNAMIC) $(HOSTSDK_STATIC) $(HOSTSDK_DYNAMIC) $(PLUGIN_TARGET) $(HOST_TARGET) *~ */*~ 189 rm -f $(SDK_STATIC) $(SDK_DYNAMIC) $(HOSTSDK_STATIC) $(HOSTSDK_DYNAMIC) $(PLUGIN_TARGET) $(HOST_TARGET) *~ */*~
158 190
159 install: $(SDK_STATIC) $(SDK_DYNAMIC) $(HOSTSDK_STATIC) $(HOSTSDK_DYNAMIC) $(PLUGIN_TARGET) $(HOST_TARGET) 191 install: $(SDK_STATIC) $(SDK_DYNAMIC) $(HOSTSDK_STATIC) $(HOSTSDK_DYNAMIC) $(PLUGIN_TARGET) $(HOST_TARGET)
160 mkdir -p $(INSTALL_API_HEADERS) 192 mkdir -p $(INSTALL_API_HEADERS)
161 mkdir -p $(INSTALL_SDK_HEADERS) 193 mkdir -p $(INSTALL_SDK_HEADERS)
194 mkdir -p $(INSTALL_HOSTEXT_HEADERS)
162 mkdir -p $(INSTALL_SDK_LIBS) 195 mkdir -p $(INSTALL_SDK_LIBS)
163 mkdir -p $(INSTALL_PKGCONFIG) 196 mkdir -p $(INSTALL_PKGCONFIG)
164 cp $(API_HEADERS) $(INSTALL_API_HEADERS) 197 cp $(API_HEADERS) $(INSTALL_API_HEADERS)
165 cp $(SDK_HEADERS) $(INSTALL_SDK_HEADERS) 198 cp $(SDK_HEADERS) $(INSTALL_SDK_HEADERS)
166 cp $(HOSTSDK_HEADERS) $(INSTALL_SDK_HEADERS) 199 cp $(HOSTSDK_HEADERS) $(INSTALL_SDK_HEADERS)
200 cp $(HOSTEXT_HEADERS) $(INSTALL_HOSTEXT_HEADERS)
167 cp $(SDK_STATIC) $(INSTALL_SDK_LIBS) 201 cp $(SDK_STATIC) $(INSTALL_SDK_LIBS)
168 cp $(HOSTSDK_STATIC) $(INSTALL_SDK_LIBS) 202 cp $(HOSTSDK_STATIC) $(INSTALL_SDK_LIBS)
169 cp $(SDK_DYNAMIC) $(INSTALL_SDK_LIBS)/$(INSTALL_SDK_LIBNAME) 203 cp $(SDK_DYNAMIC) $(INSTALL_SDK_LIBS)/$(INSTALL_SDK_LIBNAME)
170 cp $(HOSTSDK_DYNAMIC) $(INSTALL_SDK_LIBS)/$(INSTALL_HOSTSDK_LIBNAME) 204 cp $(HOSTSDK_DYNAMIC) $(INSTALL_SDK_LIBS)/$(INSTALL_HOSTSDK_LIBNAME)
171 rm -f $(INSTALL_SDK_LIBS)/$(INSTALL_SDK_LINK_ABI) 205 rm -f $(INSTALL_SDK_LIBS)/$(INSTALL_SDK_LINK_ABI)