comparison Makefile @ 58:0284955e31e5 host-factory-stuff

* reshuffle
author cannam
date Thu, 24 May 2007 10:05:00 +0000
parents 09a1aac6c362
children fa79c4ec847d
comparison
equal deleted inserted replaced
57:09a1aac6c362 58:0284955e31e5
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 ## Choose your
7
8 APIDIR = vamp
6 SDKDIR = vamp-sdk 9 SDKDIR = vamp-sdk
7 HOSTSDKDIR = vamp-hostsdk 10 HOSTEXTDIR = vamp-sdk/hostext
8 APIDIR = vamp
9 EXAMPLEDIR = examples 11 EXAMPLEDIR = examples
10 HOSTDIR = host 12 HOSTDIR = host
11 13
12 14 ###
13 ### Start of user-serviceable parts 15 ### Start of user-serviceable parts
16 ###
17
18 # Default build target (or use "make <target>" to select one).
19 # Targets are:
20 # all -- build everything
21 # sdk -- build all the Vamp SDK libraries for plugins and hosts
22 # plugins -- build the example plugins (and the SDK if required)
23 # host -- build the simple Vamp plugin host (and the SDK if required)
24 # test -- build the host and example plugins, and run a quick test
25 # clean -- remove binary targets
26 # distclean -- remove all targets
27 #
28 default: all
29
30 # Compile flags
31 #
32 CXXFLAGS := $(CXXFLAGS) -O2 -Wall -I$(SDKDIR) -I$(HOSTEXTDIR) -I$(APIDIR) -I.
33
34 # Libraries required for the plugins.
35 # (Note that it is desirable to statically link libstdc++ if possible,
36 # because our plugin exposes only a C API so there are no boundary
37 # compatibility problems.)
38 #
39 PLUGIN_LIBS = $(SDKDIR)/libvamp-sdk.a
40 #PLUGIN_LIBS = vamp-sdk/libvamp-sdk.a $(shell g++ -print-file-name=libstdc++.a)
41
42 # Flags required to tell the compiler to link to a dynamically loadable object
43 #
44 PLUGIN_LDFLAGS = -shared -Wl,-Bsymbolic -static-libgcc
45
46 # File extension for a dynamically loadable object
47 #
48 PLUGIN_EXT = .so
49
50 ## For OS/X with g++:
51 #PLUGIN_LDFLAGS = -dynamiclib
52 #PLUGIN_EXT = .dylib
53
54 # Libraries required for the host.
55 #
56 HOST_LIBS = $(SDKDIR)/libvamp-hostsdk.a -lsndfile -ldl
14 57
15 # Locations for "make install". This will need quite a bit of 58 # Locations for "make install". This will need quite a bit of
16 # editing for non-Linux platforms. Of course you don't necessarily 59 # editing for non-Linux platforms. Of course you don't necessarily
17 # have to use "make install". 60 # have to use "make install".
18 # 61 #
33 INSTALL_HOSTSDK_STATIC := libvamp-hostsdk.a 76 INSTALL_HOSTSDK_STATIC := libvamp-hostsdk.a
34 INSTALL_HOSTSDK_LA := libvamp-hostsdk.la 77 INSTALL_HOSTSDK_LA := libvamp-hostsdk.la
35 78
36 INSTALL_PKGCONFIG := $(INSTALL_PREFIX)/lib/pkgconfig 79 INSTALL_PKGCONFIG := $(INSTALL_PREFIX)/lib/pkgconfig
37 80
38 # Compile flags
39 #
40 CXXFLAGS := $(CXXFLAGS) -O2 -Wall -I$(SDKDIR) -I$(HOSTSDKDIR) -I$(APIDIR) -I.
41
42 # Libraries required for the host at link time
43 #
44 HOST_LIBS = $(HOSTSDKDIR)/libvamp-hostsdk.a -lsndfile -ldl
45
46 # Libraries required for the plugin. Note that we can (and actively
47 # want to) statically link libstdc++, because our plugin exposes only
48 # a C API so there are no boundary compatibility problems.
49 #
50 PLUGIN_LIBS = $(SDKDIR)/libvamp-sdk.a
51 #PLUGIN_LIBS = vamp-sdk/libvamp-sdk.a $(shell g++ -print-file-name=libstdc++.a)
52
53 # Flags required to tell the compiler to link to a dynamically loadable object
54 #
55 PLUGIN_LDFLAGS = -shared -Wl,-Bsymbolic -static-libgcc
56
57 # File extension for a dynamically loadable object
58 #
59 PLUGIN_EXT = .so
60
61 ## For OS/X with g++:
62 #PLUGIN_LDFLAGS = -dynamiclib
63 #PLUGIN_EXT = .dylib
64
65 ### End of user-serviceable parts 81 ### End of user-serviceable parts
66 82
67 83
68 API_HEADERS = \ 84 API_HEADERS = \
69 $(APIDIR)/vamp.h 85 $(APIDIR)/vamp.h
75 $(SDKDIR)/RealTime.h 91 $(SDKDIR)/RealTime.h
76 92
77 HOSTSDK_HEADERS = \ 93 HOSTSDK_HEADERS = \
78 $(SDKDIR)/Plugin.h \ 94 $(SDKDIR)/Plugin.h \
79 $(SDKDIR)/PluginBase.h \ 95 $(SDKDIR)/PluginBase.h \
80 $(HOSTSDKDIR)/PluginHostAdapter.h \ 96 $(SDKDIR)/PluginHostAdapter.h \
81 $(HOSTSDKDIR)/PluginInputDomainAdapter.h \ 97 $(HOSTEXTDIR)/PluginInputDomainAdapter.h \
82 $(HOSTSDKDIR)/PluginLoader.h \ 98 $(HOSTEXTDIR)/PluginLoader.h \
83 $(HOSTSDKDIR)/PluginWrapper.h \ 99 $(HOSTEXTDIR)/PluginWrapper.h \
84 $(SDKDIR)/RealTime.h 100 $(SDKDIR)/RealTime.h
85 101
86 SDK_OBJECTS = \ 102 SDK_OBJECTS = \
87 $(SDKDIR)/PluginAdapter.o \ 103 $(SDKDIR)/PluginAdapter.o \
88 $(SDKDIR)/RealTime.o 104 $(SDKDIR)/RealTime.o
89 105
90 HOSTSDK_OBJECTS = \ 106 HOSTSDK_OBJECTS = \
91 $(HOSTSDKDIR)/PluginHostAdapter.o \ 107 $(SDKDIR)/PluginHostAdapter.o \
92 $(HOSTSDKDIR)/PluginInputDomainAdapter.o \ 108 $(HOSTEXTDIR)/PluginInputDomainAdapter.o \
93 $(HOSTSDKDIR)/PluginLoader.o \ 109 $(HOSTEXTDIR)/PluginLoader.o \
94 $(HOSTSDKDIR)/PluginWrapper.o \ 110 $(HOSTEXTDIR)/PluginWrapper.o \
95 $(SDKDIR)/RealTime.o 111 $(SDKDIR)/RealTime.o
96 112
97 SDK_STATIC = \ 113 SDK_STATIC = \
98 $(SDKDIR)/libvamp-sdk.a 114 $(SDKDIR)/libvamp-sdk.a
99 115
100 HOSTSDK_STATIC = \ 116 HOSTSDK_STATIC = \
101 $(HOSTSDKDIR)/libvamp-hostsdk.a 117 $(SDKDIR)/libvamp-hostsdk.a
102 118
103 SDK_DYNAMIC = \ 119 SDK_DYNAMIC = \
104 $(SDKDIR)/libvamp-sdk.so 120 $(SDKDIR)/libvamp-sdk.so
105 121
106 HOSTSDK_DYNAMIC = \ 122 HOSTSDK_DYNAMIC = \
107 $(HOSTSDKDIR)/libvamp-hostsdk.so 123 $(SDKDIR)/libvamp-hostsdk.so
108 124
109 SDK_LA = \ 125 SDK_LA = \
110 $(SDKDIR)/libvamp-sdk.la 126 $(SDKDIR)/libvamp-sdk.la
111 127
112 PLUGIN_HEADERS = \ 128 PLUGIN_HEADERS = \
132 $(HOSTDIR)/vamp-simple-host.o 148 $(HOSTDIR)/vamp-simple-host.o
133 149
134 HOST_TARGET = \ 150 HOST_TARGET = \
135 $(HOSTDIR)/vamp-simple-host 151 $(HOSTDIR)/vamp-simple-host
136 152
137 all: $(SDK_STATIC) $(SDK_DYNAMIC) $(HOSTSDK_STATIC) $(HOSTSDK_DYNAMIC) $(PLUGIN_TARGET) $(HOST_TARGET) test 153 sdk: $(SDK_STATIC) $(SDK_DYNAMIC) $(HOSTSDK_STATIC) $(HOSTSDK_DYNAMIC)
154
155 plugins: sdk $(PLUGIN_TARGET)
156
157 host: sdk $(HOST_TARGET)
158
159 all: sdk plugins host test
138 160
139 $(SDK_STATIC): $(SDK_OBJECTS) $(API_HEADERS) $(SDK_HEADERS) 161 $(SDK_STATIC): $(SDK_OBJECTS) $(API_HEADERS) $(SDK_HEADERS)
140 $(AR) r $@ $(SDK_OBJECTS) 162 $(AR) r $@ $(SDK_OBJECTS)
141 163
142 $(HOSTSDK_STATIC): $(HOSTSDK_OBJECTS) $(API_HEADERS) $(HOSTSDK_HEADERS) 164 $(HOSTSDK_STATIC): $(HOSTSDK_OBJECTS) $(API_HEADERS) $(HOSTSDK_HEADERS)
152 $(CXX) $(LDFLAGS) $(PLUGIN_LDFLAGS) -o $@ $(PLUGIN_OBJECTS) $(PLUGIN_LIBS) 174 $(CXX) $(LDFLAGS) $(PLUGIN_LDFLAGS) -o $@ $(PLUGIN_OBJECTS) $(PLUGIN_LIBS)
153 175
154 $(HOST_TARGET): $(HOST_OBJECTS) $(HOSTSDK_TARGET) $(HOST_HEADERS) 176 $(HOST_TARGET): $(HOST_OBJECTS) $(HOSTSDK_TARGET) $(HOST_HEADERS)
155 $(CXX) $(LDFLAGS) $(HOST_LDFLAGS) -o $@ $(HOST_OBJECTS) $(HOST_LIBS) 177 $(CXX) $(LDFLAGS) $(HOST_LDFLAGS) -o $@ $(HOST_OBJECTS) $(HOST_LIBS)
156 178
157 test: $(HOST_TARGET) $(PLUGIN_TARGET) 179 test: plugins host
158 $(HOST_TARGET) $(PLUGIN_TARGET) 180 $(HOST_TARGET) $(PLUGIN_TARGET)
159 181
160 clean: 182 clean:
161 rm -f $(SDK_OBJECTS) $(HOSTSDK_OBJECTS) $(PLUGIN_OBJECTS) $(HOST_OBJECTS) 183 rm -f $(SDK_OBJECTS) $(HOSTSDK_OBJECTS) $(PLUGIN_OBJECTS) $(HOST_OBJECTS)
162 184