+++ /dev/null
-
-# Location of our plugins
-#
-PLUGINDIR = plugins
-
-# Compile flags
-#
-CFLAGS := -fPIC -DDEBUG -O2 -Wall $(CFLAGS)
-CXXFLAGS := $(CFLAGS)
-LDFLAGS := -laubio $(LDFLAGS)
-
-# Libraries required for the plugins.
-#
-PLUGIN_LIBS = -Wl,-Bstatic -lvamp-sdk -Wl,-Bdynamic
-
-# Flags required to tell the compiler to make a dynamically loadable object
-#
-PLUGIN_LDFLAGS = -shared -Wl,-Bsymbolic -Wl,--version-script=vamp-plugin.map
-
-# File extension for a dynamically loadable object
-#
-PLUGIN_EXT = .so
-
-## For OS/X with g++:
-#PLUGIN_LDFLAGS = -dynamiclib -exported_symbols_list=vamp-plugin.list
-#PLUGIN_EXT = .dylib
-
-
-### End of user-serviceable parts
-
-PLUGIN_OBJECTS = libmain.o $(patsubst %.cpp,%.o,$(wildcard $(PLUGINDIR)/*.cpp))
-PLUGIN_HEADERS = $(patsubst %.cpp,%.h,$(wildcard $(PLUGINDIR)/*.cpp))
-PLUGIN_TARGET = vamp-aubio$(PLUGIN_EXT)
-
-all: $(PLUGIN_TARGET)
-
-$(PLUGIN_TARGET): $(PLUGIN_OBJECTS) $(PLUGIN_HEADERS)
- $(CXX) $(LDFLAGS) $(PLUGIN_LDFLAGS) -o $@ $(PLUGIN_OBJECTS) $(PLUGIN_LIBS)
-
-clean:
- rm -f $(PLUGIN_OBJECTS)
-
-distclean: clean
- rm -f $(PLUGIN_TARGET) *~ */*~
-
-
--- /dev/null
+# Makefile for vamp-aubio. This file gets included from platform specific makefiles.
+#
+# To build on OSX, use:
+#
+# $ make -f Makefile.osx
+#
+# To build on linux, use:
+#
+# $ make -f Makefile.linux
+#
+# To build with mingw32, use:
+#
+# $ make -f Makefile.mingw
+
+CFLAGS := $(ARCHFLAGS) $(CFLAGS)
+CXXFLAGS := $(CFLAGS) -I. -I$(VAMPSDK_DIR) $(CXXFLAGS)
+
+LDFLAGS := $(ARCHFLAGS) -L$(VAMPSDK_DIR) -laubio $(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
+
+# Location of our plugins
+#
+PLUGINDIR = plugins
+
+PLUGIN_OBJECTS = libmain.o $(patsubst %.cpp,%.o,$(wildcard $(PLUGINDIR)/*.cpp))
+PLUGIN_HEADERS = $(patsubst %.cpp,%.h,$(wildcard $(PLUGINDIR)/*.cpp))
+PLUGIN_TARGET = vamp-aubio$(PLUGIN_EXT)
+
+all: $(PLUGIN_TARGET)
+
+$(PLUGIN_TARGET): $(PLUGIN_OBJECTS) $(PLUGIN_HEADERS)
+ $(CXX) $(PLUGIN_LDFLAGS) -o $@ $(PLUGIN_OBJECTS) $(PLUGIN_LIBS)
+
+clean:
+ rm -f $(PLUGIN_OBJECTS)
+
+distclean: clean
+ rm -f $(PLUGIN_TARGET) *~ */*~
--- /dev/null
+## Makefile for Vamp aubio 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<library>
+# 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
--- /dev/null
+## Makefile for Vamp aubio 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<library>
+# 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
--- /dev/null
+## Makefile for Vamp aubio 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
+
+# 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<library>
+# options here
+PLUGIN_LDFLAGS := -dynamiclib -exported_symbols_list vamp-plugin.list -lvamp-sdk
+
+# File extension for plugin library on this platform
+PLUGIN_EXT := .dylib
+
+include Makefile.inc