# HG changeset patch # User cannam # Date 1144326404 0 # Node ID 6616075ec7b636861b2e3494f98092c00e2d0f37 # Parent 83d3eb5807315a5c02b0847ec286a337b21874b4 * Build static library of SDK sources as well diff -r 83d3eb580731 -r 6616075ec7b6 Makefile --- a/Makefile Thu Apr 06 12:01:07 2006 +0000 +++ b/Makefile Thu Apr 06 12:26:44 2006 +0000 @@ -12,20 +12,26 @@ ### Start of user-serviceable parts # Compile flags +# CXXFLAGS := $(CXXFLAGS) -O2 -Wall -I$(SDKDIR) -I$(APIDIR) -I. # Libraries required for the host at link time -HOST_LIBS = -ldl +# +HOST_LIBS = -Lvamp-sdk -lvamp-sdk -ldl # Libraries required for the plugin. Note that we can (and actively # want to) statically link with libstdc++, because our plugin exposes # a C API so there are no boundary compatibility problems. -#PLUGIN_LIBS = $(shell g++ -print-file-name=libstdc++.a) +# +PLUGIN_LIBS = -Lvamp-sdk -lvamp-sdk +#PLUGIN_LIBS = -lvamp-sdk $(shell g++ -print-file-name=libstdc++.a) # Flags required to tell the compiler to link to a dynamically loadable object +# PLUGIN_LDFLAGS = -shared -Wl,-Bsymbolic -static-libgcc # File extension for a dynamically loadable object +# PLUGIN_EXT = .so ## For OS/X with g++: @@ -34,11 +40,15 @@ ### End of user-serviceable parts +SDK_OBJECTS = \ + $(SDKDIR)/PluginAdapter.o \ + $(SDKDIR)/PluginHostAdapter.o \ + $(SDKDIR)/RealTime.o + +SDK_TARGET = \ + $(SDKDIR)/libvamp-sdk.a PLUGIN_OBJECTS = \ - $(SDKDIR)/PluginAdapter.o \ - $(SDKDIR)/PluginHostAdapter.o \ - $(SDKDIR)/RealTime.o \ $(EXAMPLEDIR)/ZeroCrossing.o \ $(EXAMPLEDIR)/SpectralCentroid.o \ $(EXAMPLEDIR)/plugins.o @@ -47,15 +57,15 @@ $(EXAMPLEDIR)/plugins$(PLUGIN_EXT) HOST_OBJECTS = \ - $(SDKDIR)/PluginAdapter.o \ - $(SDKDIR)/PluginHostAdapter.o \ - $(SDKDIR)/RealTime.o \ $(HOSTDIR)/simplehost.o HOST_TARGET = \ $(HOSTDIR)/simplehost -all: $(PLUGIN_TARGET) $(HOST_TARGET) test +all: $(SDK_TARGET) $(PLUGIN_TARGET) $(HOST_TARGET) test + +$(SDK_TARGET): $(SDK_OBJECTS) + $(AR) r $@ $^ $(PLUGIN_TARGET): $(PLUGIN_OBJECTS) $(CXX) $(LDFLAGS) $(PLUGIN_LDFLAGS) -o $@ $^ $(PLUGIN_LIBS) @@ -67,9 +77,9 @@ $(HOST_TARGET) $(PLUGIN_TARGET) clean: - rm -f $(PLUGIN_OBJECTS) $(HOST_OBJECTS) + rm -f $(SDK_OBJECTS) $(PLUGIN_OBJECTS) $(HOST_OBJECTS) distclean: clean - rm -f $(PLUGIN_TARGET) $(HOST_TARGET) *~ */*~ + rm -f $(SDK_TARGET) $(PLUGIN_TARGET) $(HOST_TARGET) *~ */*~