Makefile.mingw32: improve mingw build
[vamp-aubio-plugins.git] / Makefile.mingw32
index ef3a7f5..e932cf1 100644 (file)
@@ -6,7 +6,18 @@
 ##  Note that the list of source files, etc, goes in Makefile.inc
 ##  instead so that it can be included by all platform Makefiles.
 
+# Location of Vamp plugin SDK relative to the project directory
+VAMPSDK_DIR    ?= ../vamp-plugin-sdk
+
+# Location of libvamp-sdk.dll
+VAMPDLL_DIR ?= ../vamp-plugin-sdk-2.5-binaries-win32-mingw
+
+# Location of libaubio-4.dll
+AUBIO_MINGW32_DISTDIR ?= ../aubio-dist-mingw32
+
+# Toolchain prefix
 TOOLPREFIX     ?= i586-mingw32msvc-
+
 CXX            = $(TOOLPREFIX)g++
 CC             = $(TOOLPREFIX)gcc
 LD             = $(TOOLPREFIX)g++
@@ -19,20 +30,17 @@ RANLIB              = $(TOOLPREFIX)ranlib
 # ... 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
-
-# Location of libvamp-sdk.dll
-VAMPDLL_DIR ?= ../vamp-plugin-sdk-2.5-binaries-win32-mingw
+# add AUBIO_MINGW32_DISTDIR to ARCHFLAGS
+ARCHFLAGS := -I$(AUBIO_MINGW32_DISTDIR)/usr/local/include
 
-# Location of libaubio-4.dll
-AUBIODLL_DIR ?= ../../dist-win32/usr/local/lib
+# add AUBIO_MINGW32_DISTDIR to PLUGIN_LDFLAGS
+PLUGIN_LDFLAGS  := -L$(AUBIO_MINGW32_DISTDIR)/usr/local/lib
 
 # Libraries and linker flags required by plugin: add any -l<library>
 # options here
-PLUGIN_LDFLAGS := -shared -Wl,--retain-symbols-file=vamp-plugin.list
-PLUGIN_LIBS                    := $(VAMPDLL_DIR)/libvamp-sdk.dll $(AUBIODLL_DIR)/libaubio-4.dll
-
+PLUGIN_LDFLAGS  += -Wl,--enable-auto-import
+PLUGIN_LDFLAGS  += -shared -Wl,--retain-symbols-file=vamp-plugin.list
+PLUGIN_LIBS     := $(VAMPDLL_DIR)/libvamp-sdk.dll
 
 # File extension for plugin library on this platform
 PLUGIN_EXT     := .dll