comparison Makefile @ 51:2403ae53b8a5 vamp-plugin-sdk-v1.0pre1

* Split out the host adapter code into a separate host sdk library. Plugins link against libvamp-sdk, hosts against libvamp-hostsdk.
author cannam
date Fri, 02 Mar 2007 12:26:53 +0000
parents 2858c897d90f
children 4ab6224110ef 9d3272c7db60
comparison
equal deleted inserted replaced
50:b907557b2fb9 51:2403ae53b8a5
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 # example plugins, and the test host. Please adjust to suit your 3 # libraries, example plugins, and the test host. Please adjust to
4 # operating system requirements. 4 # suit your operating system requirements.
5 5
6 SDKDIR = vamp-sdk 6 SDKDIR = vamp-sdk
7 APIDIR = vamp 7 APIDIR = vamp
8 EXAMPLEDIR = examples 8 EXAMPLEDIR = examples
9 HOSTDIR = host 9 HOSTDIR = host
13 13
14 # Locations for "make install". This will need quite a bit of 14 # Locations for "make install". This will need quite a bit of
15 # editing for non-Linux platforms. Of course you don't necessarily 15 # editing for non-Linux platforms. Of course you don't necessarily
16 # have to use "make install". 16 # have to use "make install".
17 # 17 #
18 INSTALL_PREFIX := /usr/local 18 INSTALL_PREFIX := /usr/local
19 INSTALL_API_HEADERS := $(INSTALL_PREFIX)/include/vamp 19 INSTALL_API_HEADERS := $(INSTALL_PREFIX)/include/vamp
20 INSTALL_SDK_HEADERS := $(INSTALL_PREFIX)/include/vamp-sdk 20 INSTALL_SDK_HEADERS := $(INSTALL_PREFIX)/include/vamp-sdk
21 INSTALL_SDK_LIBS := $(INSTALL_PREFIX)/lib 21 INSTALL_SDK_LIBS := $(INSTALL_PREFIX)/lib
22 INSTALL_SDK_LIBNAME := libvamp-sdk.so.0.0.5 22
23 INSTALL_SDK_LINK_ABI := libvamp-sdk.so.0 23 INSTALL_SDK_LIBNAME := libvamp-sdk.so.1.0.0
24 INSTALL_SDK_LINK_DEV := libvamp-sdk.so 24 INSTALL_SDK_LINK_ABI := libvamp-sdk.so.1
25 INSTALL_SDK_STATIC := libvamp-sdk.a 25 INSTALL_SDK_LINK_DEV := libvamp-sdk.so
26 INSTALL_SDK_LA := libvamp-sdk.la 26 INSTALL_SDK_STATIC := libvamp-sdk.a
27 INSTALL_PKGCONFIG := $(INSTALL_PREFIX)/lib/pkgconfig 27 INSTALL_SDK_LA := libvamp-sdk.la
28
29 INSTALL_HOSTSDK_LIBNAME := libvamp-hostsdk.so.1.0.0
30 INSTALL_HOSTSDK_LINK_ABI := libvamp-hostsdk.so.1
31 INSTALL_HOSTSDK_LINK_DEV := libvamp-hostsdk.so
32 INSTALL_HOSTSDK_STATIC := libvamp-hostsdk.a
33 INSTALL_HOSTSDK_LA := libvamp-hostsdk.la
34
35 INSTALL_PKGCONFIG := $(INSTALL_PREFIX)/lib/pkgconfig
28 36
29 # Compile flags 37 # Compile flags
30 # 38 #
31 CXXFLAGS := $(CXXFLAGS) -O2 -Wall -I$(SDKDIR) -I$(APIDIR) -I. 39 CXXFLAGS := $(CXXFLAGS) -O2 -Wall -I$(SDKDIR) -I$(APIDIR) -I.
32 #CXXFLAGS := $(CXXFLAGS) -g -Wall -I$(SDKDIR) -I$(APIDIR) -I.
33 40
34 # Libraries required for the host at link time 41 # Libraries required for the host at link time
35 # 42 #
36 HOST_LIBS = vamp-sdk/libvamp-sdk.a -lsndfile -ldl 43 HOST_LIBS = vamp-sdk/libvamp-hostsdk.a -lsndfile -ldl
37 44
38 # Libraries required for the plugin. Note that we can (and actively 45 # Libraries required for the plugin. Note that we can (and actively
39 # want to) statically link libstdc++, because our plugin exposes only 46 # want to) statically link libstdc++, because our plugin exposes only
40 # a C API so there are no boundary compatibility problems. 47 # a C API so there are no boundary compatibility problems.
41 # 48 #
62 69
63 SDK_HEADERS = \ 70 SDK_HEADERS = \
64 $(SDKDIR)/Plugin.h \ 71 $(SDKDIR)/Plugin.h \
65 $(SDKDIR)/PluginAdapter.h \ 72 $(SDKDIR)/PluginAdapter.h \
66 $(SDKDIR)/PluginBase.h \ 73 $(SDKDIR)/PluginBase.h \
74 $(SDKDIR)/RealTime.h
75
76 HOSTSDK_HEADERS = \
77 $(SDKDIR)/Plugin.h \
78 $(SDKDIR)/PluginBase.h \
67 $(SDKDIR)/PluginHostAdapter.h \ 79 $(SDKDIR)/PluginHostAdapter.h \
68 $(SDKDIR)/RealTime.h 80 $(SDKDIR)/RealTime.h
69 81
70 SDK_OBJECTS = \ 82 SDK_OBJECTS = \
71 $(SDKDIR)/PluginAdapter.o \ 83 $(SDKDIR)/PluginAdapter.o \
84 $(SDKDIR)/RealTime.o
85
86 HOSTSDK_OBJECTS = \
72 $(SDKDIR)/PluginHostAdapter.o \ 87 $(SDKDIR)/PluginHostAdapter.o \
73 $(SDKDIR)/RealTime.o 88 $(SDKDIR)/RealTime.o
74 89
75 SDK_STATIC = \ 90 SDK_STATIC = \
76 $(SDKDIR)/libvamp-sdk.a 91 $(SDKDIR)/libvamp-sdk.a
77 92
93 HOSTSDK_STATIC = \
94 $(SDKDIR)/libvamp-hostsdk.a
95
78 SDK_DYNAMIC = \ 96 SDK_DYNAMIC = \
79 $(SDKDIR)/libvamp-sdk.so 97 $(SDKDIR)/libvamp-sdk.so
98
99 HOSTSDK_DYNAMIC = \
100 $(SDKDIR)/libvamp-hostsdk.so
80 101
81 SDK_LA = \ 102 SDK_LA = \
82 $(SDKDIR)/libvamp-sdk.la 103 $(SDKDIR)/libvamp-sdk.la
83 104
84 PLUGIN_HEADERS = \ 105 PLUGIN_HEADERS = \
104 $(HOSTDIR)/vamp-simple-host.o 125 $(HOSTDIR)/vamp-simple-host.o
105 126
106 HOST_TARGET = \ 127 HOST_TARGET = \
107 $(HOSTDIR)/vamp-simple-host 128 $(HOSTDIR)/vamp-simple-host
108 129
109 all: $(SDK_STATIC) $(SDK_DYNAMIC) $(PLUGIN_TARGET) $(HOST_TARGET) test 130 all: $(SDK_STATIC) $(SDK_DYNAMIC) $(HOSTSDK_STATIC) $(HOSTSDK_DYNAMIC) $(PLUGIN_TARGET) $(HOST_TARGET) test
110 131
111 $(SDK_STATIC): $(SDK_OBJECTS) $(API_HEADERS) $(SDK_HEADERS) 132 $(SDK_STATIC): $(SDK_OBJECTS) $(API_HEADERS) $(SDK_HEADERS)
112 $(AR) r $@ $(SDK_OBJECTS) 133 $(AR) r $@ $(SDK_OBJECTS)
113 134
135 $(HOSTSDK_STATIC): $(HOSTSDK_OBJECTS) $(API_HEADERS) $(HOSTSDK_HEADERS)
136 $(AR) r $@ $(HOSTSDK_OBJECTS)
137
114 $(SDK_DYNAMIC): $(SDK_OBJECTS) $(API_HEADERS) $(SDK_HEADERS) 138 $(SDK_DYNAMIC): $(SDK_OBJECTS) $(API_HEADERS) $(SDK_HEADERS)
115 $(CXX) $(LDFLAGS) $(PLUGIN_LDFLAGS) -o $@ $(SDK_OBJECTS) 139 $(CXX) $(LDFLAGS) $(PLUGIN_LDFLAGS) -o $@ $(SDK_OBJECTS)
140
141 $(HOSTSDK_DYNAMIC): $(HOSTSDK_OBJECTS) $(API_HEADERS) $(HOSTSDK_HEADERS)
142 $(CXX) $(LDFLAGS) $(PLUGIN_LDFLAGS) -o $@ $(HOSTSDK_OBJECTS)
116 143
117 $(PLUGIN_TARGET): $(PLUGIN_OBJECTS) $(SDK_TARGET) $(PLUGIN_HEADERS) 144 $(PLUGIN_TARGET): $(PLUGIN_OBJECTS) $(SDK_TARGET) $(PLUGIN_HEADERS)
118 $(CXX) $(LDFLAGS) $(PLUGIN_LDFLAGS) -o $@ $(PLUGIN_OBJECTS) $(PLUGIN_LIBS) 145 $(CXX) $(LDFLAGS) $(PLUGIN_LDFLAGS) -o $@ $(PLUGIN_OBJECTS) $(PLUGIN_LIBS)
119 146
120 $(HOST_TARGET): $(HOST_OBJECTS) $(SDK_TARGET) $(HOST_HEADERS) 147 $(HOST_TARGET): $(HOST_OBJECTS) $(HOSTSDK_TARGET) $(HOST_HEADERS)
121 $(CXX) $(LDFLAGS) $(HOST_LDFLAGS) -o $@ $(HOST_OBJECTS) $(HOST_LIBS) 148 $(CXX) $(LDFLAGS) $(HOST_LDFLAGS) -o $@ $(HOST_OBJECTS) $(HOST_LIBS)
122 149
123 test: $(HOST_TARGET) $(PLUGIN_TARGET) 150 test: $(HOST_TARGET) $(PLUGIN_TARGET)
124 $(HOST_TARGET) $(PLUGIN_TARGET) 151 $(HOST_TARGET) $(PLUGIN_TARGET)
125 152
126 clean: 153 clean:
127 rm -f $(SDK_OBJECTS) $(PLUGIN_OBJECTS) $(HOST_OBJECTS) 154 rm -f $(SDK_OBJECTS) $(HOSTSDK_OBJECTS) $(PLUGIN_OBJECTS) $(HOST_OBJECTS)
128 155
129 distclean: clean 156 distclean: clean
130 rm -f $(SDK_STATIC) $(SDK_DYNAMIC) $(PLUGIN_TARGET) $(HOST_TARGET) *~ */*~ 157 rm -f $(SDK_STATIC) $(SDK_DYNAMIC) $(HOSTSDK_STATIC) $(HOSTSDK_DYNAMIC) $(PLUGIN_TARGET) $(HOST_TARGET) *~ */*~
131 158
132 install: $(SDK_STATIC) $(SDK_DYNAMIC) $(PLUGIN_TARGET) $(HOST_TARGET) 159 install: $(SDK_STATIC) $(SDK_DYNAMIC) $(HOSTSDK_STATIC) $(HOSTSDK_DYNAMIC) $(PLUGIN_TARGET) $(HOST_TARGET)
133 mkdir -p $(INSTALL_API_HEADERS) 160 mkdir -p $(INSTALL_API_HEADERS)
134 mkdir -p $(INSTALL_SDK_HEADERS) 161 mkdir -p $(INSTALL_SDK_HEADERS)
135 mkdir -p $(INSTALL_SDK_LIBS) 162 mkdir -p $(INSTALL_SDK_LIBS)
136 mkdir -p $(INSTALL_PKGCONFIG) 163 mkdir -p $(INSTALL_PKGCONFIG)
137 cp $(API_HEADERS) $(INSTALL_API_HEADERS) 164 cp $(API_HEADERS) $(INSTALL_API_HEADERS)
138 cp $(SDK_HEADERS) $(INSTALL_SDK_HEADERS) 165 cp $(SDK_HEADERS) $(INSTALL_SDK_HEADERS)
166 cp $(HOSTSDK_HEADERS) $(INSTALL_SDK_HEADERS)
139 cp $(SDK_STATIC) $(INSTALL_SDK_LIBS) 167 cp $(SDK_STATIC) $(INSTALL_SDK_LIBS)
168 cp $(HOSTSDK_STATIC) $(INSTALL_SDK_LIBS)
140 cp $(SDK_DYNAMIC) $(INSTALL_SDK_LIBS)/$(INSTALL_SDK_LIBNAME) 169 cp $(SDK_DYNAMIC) $(INSTALL_SDK_LIBS)/$(INSTALL_SDK_LIBNAME)
170 cp $(HOSTSDK_DYNAMIC) $(INSTALL_SDK_LIBS)/$(INSTALL_HOSTSDK_LIBNAME)
141 rm -f $(INSTALL_SDK_LIBS)/$(INSTALL_SDK_LINK_ABI) 171 rm -f $(INSTALL_SDK_LIBS)/$(INSTALL_SDK_LINK_ABI)
142 ln -s $(INSTALL_SDK_LIBNAME) $(INSTALL_SDK_LIBS)/$(INSTALL_SDK_LINK_ABI) 172 ln -s $(INSTALL_SDK_LIBNAME) $(INSTALL_SDK_LIBS)/$(INSTALL_SDK_LINK_ABI)
173 rm -f $(INSTALL_SDK_LIBS)/$(INSTALL_HOSTSDK_LINK_ABI)
174 ln -s $(INSTALL_HOSTSDK_LIBNAME) $(INSTALL_SDK_LIBS)/$(INSTALL_HOSTSDK_LINK_ABI)
143 rm -f $(INSTALL_SDK_LIBS)/$(INSTALL_SDK_LINK_DEV) 175 rm -f $(INSTALL_SDK_LIBS)/$(INSTALL_SDK_LINK_DEV)
144 ln -s $(INSTALL_SDK_LIBNAME) $(INSTALL_SDK_LIBS)/$(INSTALL_SDK_LINK_DEV) 176 ln -s $(INSTALL_SDK_LIBNAME) $(INSTALL_SDK_LIBS)/$(INSTALL_SDK_LINK_DEV)
177 rm -f $(INSTALL_SDK_LIBS)/$(INSTALL_HOSTSDK_LINK_DEV)
178 ln -s $(INSTALL_HOSTSDK_LIBNAME) $(INSTALL_SDK_LIBS)/$(INSTALL_HOSTSDK_LINK_DEV)
145 sed "s,%PREFIX%,$(INSTALL_PREFIX)," $(APIDIR)/vamp.pc.in \ 179 sed "s,%PREFIX%,$(INSTALL_PREFIX)," $(APIDIR)/vamp.pc.in \
146 > $(INSTALL_PKGCONFIG)/vamp.pc 180 > $(INSTALL_PKGCONFIG)/vamp.pc
147 sed "s,%PREFIX%,$(INSTALL_PREFIX)," $(SDKDIR)/vamp-sdk.pc.in \ 181 sed "s,%PREFIX%,$(INSTALL_PREFIX)," $(SDKDIR)/vamp-sdk.pc.in \
148 > $(INSTALL_PKGCONFIG)/vamp-sdk.pc 182 > $(INSTALL_PKGCONFIG)/vamp-sdk.pc
183 sed "s,%PREFIX%,$(INSTALL_PREFIX)," $(SDKDIR)/vamp-hostsdk.pc.in \
184 > $(INSTALL_PKGCONFIG)/vamp-hostsdk.pc
149 sed -e "s,%LIBNAME%,$(INSTALL_SDK_LIBNAME),g" \ 185 sed -e "s,%LIBNAME%,$(INSTALL_SDK_LIBNAME),g" \
150 -e "s,%LINK_ABI%,$(INSTALL_SDK_LINK_ABI),g" \ 186 -e "s,%LINK_ABI%,$(INSTALL_SDK_LINK_ABI),g" \
151 -e "s,%LINK_DEV%,$(INSTALL_SDK_LINK_DEV),g" \ 187 -e "s,%LINK_DEV%,$(INSTALL_SDK_LINK_DEV),g" \
152 -e "s,%STATIC%,$(INSTALL_SDK_STATIC),g" \ 188 -e "s,%STATIC%,$(INSTALL_SDK_STATIC),g" \
153 -e "s,%LIBS%,$(INSTALL_SDK_LIBS),g" $(SDK_LA).in \ 189 -e "s,%LIBS%,$(INSTALL_SDK_LIBS),g" $(SDK_LA).in \
154 > $(INSTALL_SDK_LIBS)/$(INSTALL_SDK_LA) 190 > $(INSTALL_SDK_LIBS)/$(INSTALL_SDK_LA)
191 sed -e "s,%LIBNAME%,$(INSTALL_HOSTSDK_LIBNAME),g" \
192 -e "s,%LINK_ABI%,$(INSTALL_HOSTSDK_LINK_ABI),g" \
193 -e "s,%LINK_DEV%,$(INSTALL_HOSTSDK_LINK_DEV),g" \
194 -e "s,%STATIC%,$(INSTALL_HOSTSDK_STATIC),g" \
195 -e "s,%LIBS%,$(INSTALL_SDK_LIBS),g" $(SDK_LA).in \
196 > $(INSTALL_SDK_LIBS)/$(INSTALL_HOSTSDK_LA)
197