# HG changeset patch # User Chris Cannam # Date 1410530095 -3600 # Node ID 44d8e5dc19024de70b624873e21a900416b48ddb # Parent 4010960c659e9c6ef604fd836b31462dc68cbaee Split out Makefile to separate single-platform versions and an .inc file diff -r 4010960c659e -r 44d8e5dc1902 Makefile --- a/Makefile Thu Sep 04 14:33:36 2014 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,109 +0,0 @@ - -## Skeleton Makefile for Vamp plugin builds using command-line tools. -## This requires GNU make, which is what you get with OS/X, Linux, or -## MinGW/Cygwin on Windows. -## -## Rename this to Makefile, and edit as appropriate. -## This Makefile WILL NOT WORK until you have edited it as described -## below -- the Makefile as supplied does nothing useful at all! -## -## Various sets of options are provided, commented out -- just uncomment -## (remove the '#' characters for) the set that most closely resembles -## your own situation, and adjust to taste. Then run "gmake". -## -## (For Windows builds using MS Visual Studio, start instead with the -## VampExamplePlugins project found in the build directory of the SDK.) - - -# Edit this to the base name of your plugin library -# -PLUGIN_LIBRARY_NAME := tempogram - -# Edit this to list the .cpp or .c files in your plugin project -# -PLUGIN_SOURCES := TempogramPlugin.cpp FIRFilter.cpp WindowFunction.cpp plugins.cpp NoveltyCurveProcessor.cpp SpectrogramProcessor.cpp AutocorrelationProcessor.cpp - -# Edit this to list the .h files in your plugin project -# -PLUGIN_HEADERS := TempogramPlugin.h FIRFilter.h WindowFunction.h NoveltyCurveProcessor.h SpectrogramProcessor.h AutocorrelationProcessor.h - -# Edit this to the location of the Vamp plugin SDK, relative to your -# project directory -# -#VAMP_SDK_DIR := ../../vamp-plugin-sdk -VAMP_SDK_DIR := /usr/local/include - - -## Uncomment these for an OS/X universal binary (32- and 64-bit Intel) -## supporting 10.5 or newer. Use this if you have OS/X 10.7 with the -## Xcode 4 command-line tools. - -CXX := g++ -#-mmacosx-version-min=10.6 -CXXFLAGS := -g -mmacosx-version-min=10.6 -arch x86_64 -I$(VAMP_SDK_DIR) -Wall -Wextra -fPIC -PLUGIN_EXT := .dylib -LDFLAGS := $(CXXFLAGS) -dynamiclib -install_name $(PLUGIN_LIBRARY_NAME)$(PLUGIN_EXT) /usr/local/lib/libvamp-sdk.a -exported_symbols_list vamp-plugin.list - - -## Uncomment these for an OS/X universal binary (PPC and 32- and -## 64-bit Intel) supporting 10.5 or newer. Use this if you have OS/X -## 10.6 with the Xcode 3 command-line tools. - -# CXXFLAGS := -isysroot /Developer/SDKs/MacOSX10.5.sdk -mmacosx-version-min=10.5 -arch i386 -arch x86_64 -arch ppc -I$(VAMP_SDK_DIR) -Wall -fPIC -# PLUGIN_EXT := .dylib -# LDFLAGS := $(CXXFLAGS) -dynamiclib -install_name $(PLUGIN_LIBRARY_NAME)$(PLUGIN_EXT) $(VAMP_SDK_DIR)/libvamp-sdk.a -exported_symbols_list vamp-plugin.list - - -## Uncomment these for an OS/X universal binary (PPC and 32- and -## 64-bit Intel) supporting 10.4 or newer. Use this if you have OS/X -## 10.4, 10.5 or 10.6 and you have the 10.4 SDK installed. - -# CXX := g++-4.0 -# CXXFLAGS := -isysroot /Developer/SDKs/MacOSX10.4u.sdk -mmacosx-version-min=10.4 -arch i386 -arch x86_64 -arch ppc -I$(VAMP_SDK_DIR) -Wall -fPIC -# PLUGIN_EXT := .dylib -# LDFLAGS := $(CXXFLAGS) -dynamiclib -install_name $(PLUGIN_LIBRARY_NAME)$(PLUGIN_EXT) $(VAMP_SDK_DIR)/libvamp-sdk.a -exported_symbols_list vamp-plugin.list - - -## Uncomment these for Linux using the standard tools: - -# CXXFLAGS := -I$(VAMP_SDK_DIR) -Wall -fPIC -g -# PLUGIN_EXT := .so -# LDFLAGS := -shared -Wl,-soname=$(PLUGIN_LIBRARY_NAME)$(PLUGIN_EXT) $(VAMP_SDK_DIR)/libvamp-sdk.a -Wl,--version-script=vamp-plugin.map - - -## Uncomment these for a cross-compile from Linux to Windows using MinGW: - -# CXX := i586-mingw32msvc-g++ -# CXXFLAGS := -I$(VAMP_SDK_DIR) -Wall -# PLUGIN_EXT := .dll -# LDFLAGS := --static-libgcc -Wl,-soname=$(PLUGIN_LIBRARY_NAME)$(PLUGIN_EXT) -shared $(VAMP_SDK_DIR)/libvamp-sdk.a - - -## Uncomment these for OpenSolaris using SunStudio compiler and GNU make: - -# CXX := CC -# CXXFLAGS := -G -I$(VAMP_SDK_DIR) +w -KPIC -# PLUGIN_EXT := .so -# LDFLAGS := -G -h$(PLUGIN_LIBRARY_NAME)$(PLUGIN_EXT) $(VAMP_SDK_DIR)/libvamp-sdk.a -Qoption ld -Mvamp-plugin.map - - - -## All of the above - -PLUGIN_OBJECTS := $(PLUGIN_SOURCES:.cpp=.o) -PLUGIN_OBJECTS := $(PLUGIN_OBJECTS:.c=.o) - -$(PLUGIN_LIBRARY_NAME)$(PLUGIN_EXT): $(PLUGIN_OBJECTS) - $(CXX) -o $@ $^ $(LDFLAGS) - -$(PLUGIN_OBJECTS): $(PLUGIN_HEADERS) - -install: $(PLUGIN_LIBRARY_NAME)$(PLUGIN_EXT) - if [ -e ~/Library/Audio/Plug-Ins/Vamp/$(PLUGIN_LIBRARY_NAME)$(PLUGIN_EXT) ] ; then \ - rm ~/Library/Audio/Plug-Ins/Vamp/$(PLUGIN_LIBRARY_NAME)$(PLUGIN_EXT) ;\ - fi ;\ - cp $(PLUGIN_LIBRARY_NAME)$(PLUGIN_EXT) ~/Library/Audio/Plug-Ins/Vamp - -clean: - rm -f *.o *.dylib - diff -r 4010960c659e -r 44d8e5dc1902 Makefile.inc --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Makefile.inc Fri Sep 12 14:54:55 2014 +0100 @@ -0,0 +1,73 @@ + +## Makefile for Vamp plugin builds using command-line tools. +## +## This file defines all of the system-independent information about +## your project: the list of source files, plugin library name, etc. +## Edit this file to make sure it has all the right information. +## +## This file does not define the system-specific stuff such as which +## compiler to use -- that goes into Makefile.osx, Makefile.mingw32, +## Makefile.linux etc. Those files all include this file, so that +## they all have a consistent set of project data. +## +## To build the plugin project, type +## +## $ gmake -f Makefile.osx +## +## or whatever the equivalent filename suffix is for your platform. +## +## This requires GNU make, which is what you get with OS/X, Linux, or +## MinGW/Cygwin on Windows. +## +## (For Windows builds using MS Visual Studio, start instead with the +## VampExamplePlugins project found in the build directory of the SDK.) + + +# Edit this to the base name of your plugin library +# +PLUGIN_LIBRARY_NAME := tempogram + +# Edit this to list the .cpp or .c files in your plugin project +# +PLUGIN_SOURCES := TempogramPlugin.cpp FIRFilter.cpp WindowFunction.cpp plugins.cpp NoveltyCurveProcessor.cpp SpectrogramProcessor.cpp AutocorrelationProcessor.cpp + +# Edit this to list the .h files in your plugin project +# +PLUGIN_HEADERS := TempogramPlugin.h FIRFilter.h WindowFunction.h NoveltyCurveProcessor.h SpectrogramProcessor.h AutocorrelationProcessor.h + + +## Normally you should not edit anything below this line + +SRC_DIR := . + +CFLAGS := $(ARCHFLAGS) $(CFLAGS) +CXXFLAGS := $(CFLAGS) -I. -I$(VAMPSDK_DIR) $(CXXFLAGS) + +LDFLAGS := $(ARCHFLAGS) $(LDFLAGS) +PLUGIN_LDFLAGS := $(LDFLAGS) $(PLUGIN_LDFLAGS) + +# Defaults, overridden from the platform-specific Makefile +VAMPSDK_DIR ?= ../vamp-plugin-sdk +PLUGIN_EXT ?= .so +CXX ?= g++ +CC ?= gcc + +PLUGIN := $(PLUGIN_LIBRARY_NAME)$(PLUGIN_EXT) + +PLUGIN_OBJECTS := $(PLUGIN_SOURCES:.cpp=.o) +PLUGIN_OBJECTS := $(PLUGIN_OBJECTS:.c=.o) + +$(PLUGIN): $(PLUGIN_OBJECTS) + $(CXX) -o $@ $^ $(PLUGIN_LDFLAGS) + +$(PLUGIN_OBJECTS): $(PLUGIN_HEADERS) + +clean: + rm -f $(OBJECTS) + +distclean: clean + rm -f $(PLUGIN) + +depend: + makedepend -Y -fMakefile.inc $(SOURCES) $(HEADERS) + diff -r 4010960c659e -r 44d8e5dc1902 Makefile.linux --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Makefile.linux Fri Sep 12 14:54:55 2014 +0100 @@ -0,0 +1,38 @@ + +## Makefile for Vamp plugin using GNU tools on Linux. +## +## Edit this to adjust compiler and library settings when +## building for Linux. +## +## Note that the list of source files, etc, goes in Makefile.inc +## instead so that it can be included by all platform Makefiles. + + +# For a debug build... + +CFLAGS := -Wall -Wextra -g -fPIC + +# ... or for a release build + +#CFLAGS := -Wall -Wextra -O3 -msse -msse2 -mfpmath=sse -ftree-vectorize -fPIC + + +# Location of Vamp plugin SDK relative to the project directory + +VAMPSDK_DIR := ../vamp-plugin-sdk + + +# Libraries and linker flags required by plugin: add any -l +# options here + +PLUGIN_LDFLAGS := -shared -Wl,-Bsymbolic -Wl,-z,defs -Wl,--version-script=vamp-plugin.map $(VAMPSDK_DIR)/libvamp-sdk.a + + +# File extension for plugin library on this platform + +PLUGIN_EXT := .so + + +include Makefile.inc + + diff -r 4010960c659e -r 44d8e5dc1902 Makefile.mingw32 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Makefile.mingw32 Fri Sep 12 14:54:55 2014 +0100 @@ -0,0 +1,43 @@ + +## Makefile for Vamp plugin using MinGW tools on Windows. +## +## Edit this to adjust compiler and library settings when +## building using MinGW. +## +## Note that the list of source files, etc, goes in Makefile.inc +## instead so that it can be included by all platform Makefiles. + +TOOLPREFIX ?= +CXX = $(TOOLPREFIX)g++ +CC = $(TOOLPREFIX)gcc +LD = $(TOOLPREFIX)g++ +AR = $(TOOLPREFIX)ar +RANLIB = $(TOOLPREFIX)ranlib + + +# For a debug build... + +CFLAGS := -Wall -Wextra -g + +# ... or for a release build + +#CFLAGS := -Wall -Wextra -O3 -ftree-vectorize + + +# Location of Vamp plugin SDK relative to the project directory + +VAMPSDK_DIR := ../vamp-plugin-sdk + + +# Libraries and linker flags required by plugin: add any -l +# options here + +PLUGIN_LDFLAGS := -shared -static -Wl,--retain-symbols-file=vamp-plugin.list $(VAMPSDK_DIR)/libvamp-sdk.a + + +# File extension for plugin library on this platform + +PLUGIN_EXT := .dll + + +include Makefile.inc diff -r 4010960c659e -r 44d8e5dc1902 Makefile.osx --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Makefile.osx Fri Sep 12 14:54:55 2014 +0100 @@ -0,0 +1,43 @@ + +## Makefile for Vamp plugin using command-line tools on OS/X. +## +## Edit this to adjust compiler and library settings when +## building for OS/X. +## +## Note that the list of source files, etc, goes in Makefile.inc +## instead so that it can be included by all platform Makefiles. + + +# For a debug build... + +CFLAGS := -Wall -Wextra -g -fPIC + +# ... or for a release build + +#CFLAGS := -Wall -Wextra -O3 -ftree-vectorize -fPIC + + +# Flags to determine processor architecture and system SDK + +ARCHFLAGS ?= -mmacosx-version-min=10.6 -arch x86_64 -arch i386 + + +# Location of Vamp plugin SDK relative to the project directory + +VAMPSDK_DIR := ../vamp-plugin-sdk + + +# Libraries and linker flags required by plugin: add any -l +# options here + +PLUGIN_LDFLAGS := -dynamiclib -exported_symbols_list vamp-plugin.list $(VAMPSDK_DIR)/libvamp-sdk.a + + +# File extension for plugin library on this platform + +PLUGIN_EXT := .dylib + + +include Makefile.inc + +