aboutsummaryrefslogtreecommitdiffhomepage
path: root/backends/Makefile
diff options
context:
space:
mode:
authorcbdev <cb@cbcdn.com>2019-08-03 18:42:39 +0200
committercbdev <cb@cbcdn.com>2019-08-03 18:42:39 +0200
commit20a6882a063404858588596bd3f12bdd9e53460a (patch)
treec13ee23aec08ac3c29a1ff9efe2e429d87041239 /backends/Makefile
parentbbeade8898200a8024169ece30c620016fd5eaf1 (diff)
downloadmidimonster-20a6882a063404858588596bd3f12bdd9e53460a.tar.gz
midimonster-20a6882a063404858588596bd3f12bdd9e53460a.tar.bz2
midimonster-20a6882a063404858588596bd3f12bdd9e53460a.zip
Windows build compatiblity
Diffstat (limited to 'backends/Makefile')
-rw-r--r--backends/Makefile26
1 files changed, 24 insertions, 2 deletions
diff --git a/backends/Makefile b/backends/Makefile
index 22cb95b..2374df0 100644
--- a/backends/Makefile
+++ b/backends/Makefile
@@ -1,12 +1,13 @@
.PHONY: all clean full
OPTIONAL_BACKENDS = ola.so
+WINDOWS_BACKENDS = loopback.dll artnet.dll osc.dll sacn.dll
LINUX_BACKENDS = midi.so evdev.so
BACKENDS = artnet.so osc.so loopback.so sacn.so lua.so
BACKEND_LIB = libmmbackend.o
SYSTEM := $(shell uname -s)
-CFLAGS += -g -fPIC -I../
+CFLAGS += -g -fPIC -I../ -Wall -Wpedantic
CPPFLAGS += -g -fPIC -I../
LDFLAGS += -shared
@@ -20,8 +21,17 @@ LDFLAGS += -undefined dynamic_lookup
endif
artnet.so: ADDITIONAL_OBJS += $(BACKEND_LIB)
+artnet.dll: ADDITIONAL_OBJS += $(BACKEND_LIB)
+artnet.dll: LDLIBS += -lws2_32
+
osc.so: ADDITIONAL_OBJS += $(BACKEND_LIB)
+osc.dll: ADDITIONAL_OBJS += $(BACKEND_LIB)
+osc.dll: LDLIBS += -lws2_32
+
sacn.so: ADDITIONAL_OBJS += $(BACKEND_LIB)
+sacn.dll: ADDITIONAL_OBJS += $(BACKEND_LIB)
+sacn.dll: LDLIBS += -lws2_32
+
midi.so: LDLIBS = -lasound
evdev.so: CFLAGS += $(shell pkg-config --cflags libevdev)
evdev.so: LDLIBS = $(shell pkg-config --libs libevdev)
@@ -33,12 +43,24 @@ lua.so: LDLIBS += $(shell pkg-config --libs lua5.3)
%.so :: %.c %.h $(BACKEND_LIB)
$(CC) $(CFLAGS) $(LDLIBS) $< $(ADDITIONAL_OBJS) -o $@ $(LDFLAGS)
+%.dll :: %.c %.h $(BACKEND_LIB)
+ $(CC) $(CFLAGS) $< $(ADDITIONAL_OBJS) -o $@ $(LDFLAGS) $(LDLIBS)
+
%.so :: %.cpp %.h
$(CXX) $(CPPFLAGS) $(LDLIBS) $< $(ADDITIONAL_OBJS) -o $@ $(LDFLAGS)
all: $(BACKEND_LIB) $(BACKENDS)
+../libmmapi.a:
+ $(MAKE) -C ../ midimonster.exe
+
+windows: export CC = x86_64-w64-mingw32-gcc
+windows: LDLIBS += -lmmapi
+windows: LDFLAGS += -L../
+windows: CFLAGS += -Wno-format -Wno-pointer-sign
+windows: ../libmmapi.a $(BACKEND_LIB) $(WINDOWS_BACKENDS)
+
full: $(BACKEND_LIB) $(BACKENDS) $(OPTIONAL_BACKENDS)
clean:
- $(RM) $(BACKEND_LIB) $(BACKENDS) $(OPTIONAL_BACKENDS)
+ $(RM) $(BACKEND_LIB) $(BACKENDS) $(OPTIONAL_BACKENDS) $(WINDOWS_BACKENDS)