comparison Makefile @ 11:6616075ec7b6

* Build static library of SDK sources as well
author cannam
date Thu, 06 Apr 2006 12:26:44 +0000
parents 83d3eb580731
children a3d35e11c3fe
comparison
equal deleted inserted replaced
10:83d3eb580731 11:6616075ec7b6
10 10
11 11
12 ### Start of user-serviceable parts 12 ### Start of user-serviceable parts
13 13
14 # Compile flags 14 # Compile flags
15 #
15 CXXFLAGS := $(CXXFLAGS) -O2 -Wall -I$(SDKDIR) -I$(APIDIR) -I. 16 CXXFLAGS := $(CXXFLAGS) -O2 -Wall -I$(SDKDIR) -I$(APIDIR) -I.
16 17
17 # Libraries required for the host at link time 18 # Libraries required for the host at link time
18 HOST_LIBS = -ldl 19 #
20 HOST_LIBS = -Lvamp-sdk -lvamp-sdk -ldl
19 21
20 # Libraries required for the plugin. Note that we can (and actively 22 # Libraries required for the plugin. Note that we can (and actively
21 # want to) statically link with libstdc++, because our plugin exposes 23 # want to) statically link with libstdc++, because our plugin exposes
22 # a C API so there are no boundary compatibility problems. 24 # a C API so there are no boundary compatibility problems.
23 #PLUGIN_LIBS = $(shell g++ -print-file-name=libstdc++.a) 25 #
26 PLUGIN_LIBS = -Lvamp-sdk -lvamp-sdk
27 #PLUGIN_LIBS = -lvamp-sdk $(shell g++ -print-file-name=libstdc++.a)
24 28
25 # Flags required to tell the compiler to link to a dynamically loadable object 29 # Flags required to tell the compiler to link to a dynamically loadable object
30 #
26 PLUGIN_LDFLAGS = -shared -Wl,-Bsymbolic -static-libgcc 31 PLUGIN_LDFLAGS = -shared -Wl,-Bsymbolic -static-libgcc
27 32
28 # File extension for a dynamically loadable object 33 # File extension for a dynamically loadable object
34 #
29 PLUGIN_EXT = .so 35 PLUGIN_EXT = .so
30 36
31 ## For OS/X with g++: 37 ## For OS/X with g++:
32 #PLUGIN_LDFLAGS = -dynamiclib 38 #PLUGIN_LDFLAGS = -dynamiclib
33 #PLUGIN_EXT = .dylib 39 #PLUGIN_EXT = .dylib
34 40
35 ### End of user-serviceable parts 41 ### End of user-serviceable parts
36 42
43 SDK_OBJECTS = \
44 $(SDKDIR)/PluginAdapter.o \
45 $(SDKDIR)/PluginHostAdapter.o \
46 $(SDKDIR)/RealTime.o
47
48 SDK_TARGET = \
49 $(SDKDIR)/libvamp-sdk.a
37 50
38 PLUGIN_OBJECTS = \ 51 PLUGIN_OBJECTS = \
39 $(SDKDIR)/PluginAdapter.o \
40 $(SDKDIR)/PluginHostAdapter.o \
41 $(SDKDIR)/RealTime.o \
42 $(EXAMPLEDIR)/ZeroCrossing.o \ 52 $(EXAMPLEDIR)/ZeroCrossing.o \
43 $(EXAMPLEDIR)/SpectralCentroid.o \ 53 $(EXAMPLEDIR)/SpectralCentroid.o \
44 $(EXAMPLEDIR)/plugins.o 54 $(EXAMPLEDIR)/plugins.o
45 55
46 PLUGIN_TARGET = \ 56 PLUGIN_TARGET = \
47 $(EXAMPLEDIR)/plugins$(PLUGIN_EXT) 57 $(EXAMPLEDIR)/plugins$(PLUGIN_EXT)
48 58
49 HOST_OBJECTS = \ 59 HOST_OBJECTS = \
50 $(SDKDIR)/PluginAdapter.o \
51 $(SDKDIR)/PluginHostAdapter.o \
52 $(SDKDIR)/RealTime.o \
53 $(HOSTDIR)/simplehost.o 60 $(HOSTDIR)/simplehost.o
54 61
55 HOST_TARGET = \ 62 HOST_TARGET = \
56 $(HOSTDIR)/simplehost 63 $(HOSTDIR)/simplehost
57 64
58 all: $(PLUGIN_TARGET) $(HOST_TARGET) test 65 all: $(SDK_TARGET) $(PLUGIN_TARGET) $(HOST_TARGET) test
66
67 $(SDK_TARGET): $(SDK_OBJECTS)
68 $(AR) r $@ $^
59 69
60 $(PLUGIN_TARGET): $(PLUGIN_OBJECTS) 70 $(PLUGIN_TARGET): $(PLUGIN_OBJECTS)
61 $(CXX) $(LDFLAGS) $(PLUGIN_LDFLAGS) -o $@ $^ $(PLUGIN_LIBS) 71 $(CXX) $(LDFLAGS) $(PLUGIN_LDFLAGS) -o $@ $^ $(PLUGIN_LIBS)
62 72
63 $(HOST_TARGET): $(HOST_OBJECTS) 73 $(HOST_TARGET): $(HOST_OBJECTS)
65 75
66 test: $(HOST_TARGET) $(PLUGIN_TARGET) 76 test: $(HOST_TARGET) $(PLUGIN_TARGET)
67 $(HOST_TARGET) $(PLUGIN_TARGET) 77 $(HOST_TARGET) $(PLUGIN_TARGET)
68 78
69 clean: 79 clean:
70 rm -f $(PLUGIN_OBJECTS) $(HOST_OBJECTS) 80 rm -f $(SDK_OBJECTS) $(PLUGIN_OBJECTS) $(HOST_OBJECTS)
71 81
72 distclean: clean 82 distclean: clean
73 rm -f $(PLUGIN_TARGET) $(HOST_TARGET) *~ */*~ 83 rm -f $(SDK_TARGET) $(PLUGIN_TARGET) $(HOST_TARGET) *~ */*~
74 84
75 85