aboutsummaryrefslogtreecommitdiffhomepage
path: root/backends
diff options
context:
space:
mode:
authorcbdev <cb@cbcdn.com>2019-12-21 20:50:55 +0100
committercbdev <cb@cbcdn.com>2019-12-21 20:50:55 +0100
commit81e00a54b701529201464ba048c47a9e55a31c91 (patch)
treef77d11807fda574d612289702b8279ce265f05c5 /backends
parent062c93b1f718730c71bc4d2a1e53e0107dd236ad (diff)
downloadmidimonster-81e00a54b701529201464ba048c47a9e55a31c91.tar.gz
midimonster-81e00a54b701529201464ba048c47a9e55a31c91.tar.bz2
midimonster-81e00a54b701529201464ba048c47a9e55a31c91.zip
Experimentally build lua backend for Windows
Diffstat (limited to 'backends')
-rw-r--r--backends/Makefile19
1 files changed, 14 insertions, 5 deletions
diff --git a/backends/Makefile b/backends/Makefile
index feefd7b..656e6b6 100644
--- a/backends/Makefile
+++ b/backends/Makefile
@@ -7,8 +7,12 @@ BACKEND_LIB = libmmbackend.o
SYSTEM := $(shell uname -s)
-CFLAGS += -g -fPIC -I../ -Wall -Wpedantic
-CPPFLAGS += -g -fPIC -I../
+# Generate debug symbols unless overridden
+CFLAGS ?= -g
+CPPFLAGS ?= -g
+
+CFLAGS += -fPIC -I../ -Wall -Wpedantic
+CPPFLAGS += -fPIC -I../
LDFLAGS += -shared
# Build Linux backends if possible
@@ -47,10 +51,13 @@ evdev.so: CFLAGS += $(shell pkg-config --cflags libevdev || echo "-DBUILD_ERROR=
evdev.so: LDLIBS = $(shell pkg-config --libs libevdev || echo "-DBUILD_ERROR=\"Missing pkg-config data for libevdev\"")
ola.so: LDLIBS = -lola
ola.so: CPPFLAGS += -Wno-write-strings
+
# The pkg-config name for liblua5.3 is subject to discussion. I prefer 'lua5.3' (which works on Debian and OSX),
# but Arch requires 'lua53' which works on Debian, too, but breaks on OSX.
lua.so: CFLAGS += $(shell pkg-config --cflags lua53 || pkg-config --cflags lua5.3 || echo "-DBUILD_ERROR=\"Missing pkg-config data for lua53\"")
lua.so: LDLIBS += $(shell pkg-config --libs lua53 || pkg-config --libs lua5.3 || echo "-DBUILD_ERROR=\"Missing pkg-config data for lua53\"")
+lua.dll: CFLAGS += $(shell pkg-config --cflags lua53 || pkg-config --cflags lua5.3 || echo "-DBUILD_ERROR=\"Missing pkg-config data for lua53\"")
+lua.dll: LDLIBS += -L../libs -llua53
%.so :: %.c %.h $(BACKEND_LIB)
$(CC) $(CFLAGS) $(LDLIBS) $< $(ADDITIONAL_OBJS) -o $@ $(LDFLAGS)
@@ -66,10 +73,12 @@ all: $(BACKEND_LIB) $(BACKENDS)
../libmmapi.a:
$(MAKE) -C ../ midimonster.exe
-windows: export CC = x86_64-w64-mingw32-gcc
-windows: LDLIBS += -lmmapi
-windows: LDFLAGS += -L../
+%.dll: export CC = x86_64-w64-mingw32-gcc
+%.dll: LDLIBS += -lmmapi
+%.dll: LDFLAGS += -L../
+%.dll: CFLAGS += -Wno-format -Wno-pointer-sign
windows: CFLAGS += -Wno-format -Wno-pointer-sign
+windows: export CC = x86_64-w64-mingw32-gcc
windows: ../libmmapi.a $(BACKEND_LIB) $(WINDOWS_BACKENDS)
full: $(BACKEND_LIB) $(BACKENDS) $(OPTIONAL_BACKENDS)