changeset 75:e98a33e56cdd

Makefile: splitted for osx/linux/mingw32
author Paul Brossier <piem@piem.org>
date Wed, 28 Jan 2015 15:31:09 +0100
parents ba4b6672a8de
children 354287950e78
files Makefile Makefile.inc Makefile.linux Makefile.mingw32 Makefile.osx
diffstat 5 files changed, 130 insertions(+), 46 deletions(-) [+]
line wrap: on
line diff
--- a/Makefile	Wed Jan 28 13:29:07 2015 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,46 +0,0 @@
-
-# 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	Thu Jan 01 00:00:00 1970 +0000
+++ b/Makefile.inc	Wed Jan 28 15:31:09 2015 +0100
@@ -0,0 +1,44 @@
+# 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	Thu Jan 01 00:00:00 1970 +0000
+++ b/Makefile.linux	Wed Jan 28 15:31:09 2015 +0100
@@ -0,0 +1,25 @@
+##  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	Thu Jan 01 00:00:00 1970 +0000
+++ b/Makefile.mingw32	Wed Jan 28 15:31:09 2015 +0100
@@ -0,0 +1,33 @@
+##  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	Thu Jan 01 00:00:00 1970 +0000
+++ b/Makefile.osx	Wed Jan 28 15:31:09 2015 +0100
@@ -0,0 +1,28 @@
+##  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