comparison Makefile @ 10:83d3eb580731

* Use a single Makefile
author cannam
date Thu, 06 Apr 2006 12:01:07 +0000
parents c66551966b5f
children 6616075ec7b6
comparison
equal deleted inserted replaced
9:44113b1e296b 10:83d3eb580731
1
2 # Makefile for the Vamp plugin SDK. This builds the SDK objects,
3 # example plugins, and the test host. Please adjust to suit your
4 # operating system requirements.
5
6 SDKDIR = vamp-sdk
7 APIDIR = vamp
8 EXAMPLEDIR = examples
9 HOSTDIR = host
1 10
2 11
3 all: examples_ host_ test 12 ### Start of user-serviceable parts
4 13
5 examples_: 14 # Compile flags
6 $(MAKE) -C examples all 15 CXXFLAGS := $(CXXFLAGS) -O2 -Wall -I$(SDKDIR) -I$(APIDIR) -I.
7 16
8 host_: 17 # Libraries required for the host at link time
9 $(MAKE) -C host all 18 HOST_LIBS = -ldl
10 19
11 test: 20 # Libraries required for the plugin. Note that we can (and actively
12 $(MAKE) -C host test 21 # want to) statically link with libstdc++, because our plugin exposes
22 # a C API so there are no boundary compatibility problems.
23 #PLUGIN_LIBS = $(shell g++ -print-file-name=libstdc++.a)
13 24
14 clean: 25 # Flags required to tell the compiler to link to a dynamically loadable object
15 $(MAKE) -C examples clean 26 PLUGIN_LDFLAGS = -shared -Wl,-Bsymbolic -static-libgcc
16 27
17 distclean: 28 # File extension for a dynamically loadable object
18 $(MAKE) -C examples distclean 29 PLUGIN_EXT = .so
19 $(MAKE) -C host distclean
20 rm -f *~ *.bak $(TARGET)
21 30
31 ## For OS/X with g++:
32 #PLUGIN_LDFLAGS = -dynamiclib
33 #PLUGIN_EXT = .dylib
34
35 ### End of user-serviceable parts
36
37
38 PLUGIN_OBJECTS = \
39 $(SDKDIR)/PluginAdapter.o \
40 $(SDKDIR)/PluginHostAdapter.o \
41 $(SDKDIR)/RealTime.o \
42 $(EXAMPLEDIR)/ZeroCrossing.o \
43 $(EXAMPLEDIR)/SpectralCentroid.o \
44 $(EXAMPLEDIR)/plugins.o
45
46 PLUGIN_TARGET = \
47 $(EXAMPLEDIR)/plugins$(PLUGIN_EXT)
48
49 HOST_OBJECTS = \
50 $(SDKDIR)/PluginAdapter.o \
51 $(SDKDIR)/PluginHostAdapter.o \
52 $(SDKDIR)/RealTime.o \
53 $(HOSTDIR)/simplehost.o
54
55 HOST_TARGET = \
56 $(HOSTDIR)/simplehost
57
58 all: $(PLUGIN_TARGET) $(HOST_TARGET) test
59
60 $(PLUGIN_TARGET): $(PLUGIN_OBJECTS)
61 $(CXX) $(LDFLAGS) $(PLUGIN_LDFLAGS) -o $@ $^ $(PLUGIN_LIBS)
62
63 $(HOST_TARGET): $(HOST_OBJECTS)
64 $(CXX) $(LDFLAGS) $(HOST_LDFLAGS) -o $@ $^ $(HOST_LIBS)
65
66 test: $(HOST_TARGET) $(PLUGIN_TARGET)
67 $(HOST_TARGET) $(PLUGIN_TARGET)
68
69 clean:
70 rm -f $(PLUGIN_OBJECTS) $(HOST_OBJECTS)
71
72 distclean: clean
73 rm -f $(PLUGIN_TARGET) $(HOST_TARGET) *~ */*~
74
75