aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorcbdev <cb@cbcdn.com>2020-08-15 11:15:01 +0200
committercbdev <cb@cbcdn.com>2020-08-15 11:15:01 +0200
commit690aec061db4cfab50b998822628f732e115e11e (patch)
treee0ceaad1c1f8a5fed28c6f34afb8eaec7137a68b
parent5716802da4778c3c7507e401bba09686e23ceb60 (diff)
downloadmidimonster-690aec061db4cfab50b998822628f732e115e11e.tar.gz
midimonster-690aec061db4cfab50b998822628f732e115e11e.tar.bz2
midimonster-690aec061db4cfab50b998822628f732e115e11e.zip
Improve some documentation
-rw-r--r--README.md2
-rw-r--r--backends/Makefile24
2 files changed, 23 insertions, 3 deletions
diff --git a/README.md b/README.md
index ea079bf..3a3fcbd 100644
--- a/README.md
+++ b/README.md
@@ -140,7 +140,7 @@ side must have exactly one channel.
Example multi-channel mapping:
```
-instance-a.channel{1..5} > instance-b.{1,2,3,4,5}
+instance-a.channel{1..5} > instance-b.{a,b,c,d,e}
```
## Backend documentation
diff --git a/backends/Makefile b/backends/Makefile
index 09f5b96..4f89b43 100644
--- a/backends/Makefile
+++ b/backends/Makefile
@@ -1,17 +1,26 @@
.PHONY: all clean full
+# Backends that can only be built on Linux
LINUX_BACKENDS = midi.so evdev.so
-WINDOWS_BACKENDS = artnet.dll osc.dll loopback.dll sacn.dll maweb.dll winmidi.dll openpixelcontrol.dll rtpmidi.dll wininput.dll
-BACKENDS = artnet.so osc.so loopback.so sacn.so lua.so maweb.so jack.so openpixelcontrol.so python.so rtpmidi.so
+# Backends that can only be built on Windows (mostly due to the .DLL extension)
+WINDOWS_BACKENDS = artnet.dll osc.dll loopback.dll sacn.dll maweb.dll winmidi.dll openpixelcontrol.dll rtpmidi.dll wininput.dll visca.dll
+# Backends that can be built on any platform that can load .SO libraries
+BACKENDS = artnet.so osc.so loopback.so sacn.so lua.so maweb.so jack.so openpixelcontrol.so python.so rtpmidi.so visca.so
+# Backends that require huge dependencies to be installed
OPTIONAL_BACKENDS = ola.so
+# Backends that need to be built manually (but still should be included in the clean target)
MANUAL_BACKENDS = lua.dll
+
+# The backend library, providing platform-independent abstractions for common things
BACKEND_LIB = libmmbackend.o
+# Evaluate which system we are on
SYSTEM := $(shell uname -s)
# Generate debug symbols unless overridden
CFLAGS ?= -g
CPPFLAGS ?= -g
+# All backends are shared libraries
CFLAGS += -fPIC -I../ -Wall -Wpedantic
CPPFLAGS += -fPIC -I../
LDFLAGS += -shared
@@ -25,6 +34,7 @@ ifeq ($(SYSTEM),Darwin)
LDFLAGS += -undefined dynamic_lookup
endif
+# Most of these next few backends just pull in the backend lib, some set additional flags
artnet.so: ADDITIONAL_OBJS += $(BACKEND_LIB)
artnet.dll: ADDITIONAL_OBJS += $(BACKEND_LIB)
artnet.dll: LDLIBS += -lws2_32
@@ -37,6 +47,10 @@ sacn.so: ADDITIONAL_OBJS += $(BACKEND_LIB)
sacn.dll: ADDITIONAL_OBJS += $(BACKEND_LIB)
sacn.dll: LDLIBS += -lws2_32
+visca.so: ADDITIONAL_OBJS += $(BACKEND_LIB)
+visca.dll: ADDITIONAL_OBJS += $(BACKEND_LIB)
+visca.dll: LDLIBS += -lws2_32
+
openpixelcontrol.so: ADDITIONAL_OBJS += $(BACKEND_LIB)
openpixelcontrol.dll: ADDITIONAL_OBJS += $(BACKEND_LIB)
openpixelcontrol.dll: LDLIBS += -lws2_32
@@ -73,6 +87,7 @@ lua.dll: LDLIBS += -L../ -llua53
python.so: CFLAGS += $(shell pkg-config --cflags python3 || pkg-config --cflags python || echo "-DBUILD_ERROR=\"Missing pkg-config data for python3\"")
python.so: CFLAGS += $(shell pkg-config --libs python3 || pkg-config --libs python || echo "-DBUILD_ERROR=\"Missing pkg-config data for python3\"")
+# Generic rules on how to build .SO/.DLL's from C and CPP sources
%.so :: %.c %.h $(BACKEND_LIB)
$(CC) $(CFLAGS) $(LDLIBS) $< $(ADDITIONAL_OBJS) -o $@ $(LDFLAGS)
@@ -82,11 +97,14 @@ python.so: CFLAGS += $(shell pkg-config --libs python3 || pkg-config --libs pyth
%.so :: %.cpp %.h
$(CXX) $(CPPFLAGS) $(LDLIBS) $< $(ADDITIONAL_OBJS) -o $@ $(LDFLAGS)
+# This is the actual first named target, and thus the default
all: $(BACKEND_LIB) $(BACKENDS)
+# Build an import lib for the windows build if it's not already there
../libmmapi.a:
$(MAKE) -C ../ midimonster.exe
+# Override a bunch of stuff for the windows target and it's DLL dependencies
%.dll: export CC = x86_64-w64-mingw32-gcc
%.dll: LDLIBS += -lmmapi
%.dll: LDFLAGS += -L../
@@ -95,7 +113,9 @@ windows: CFLAGS += -Wno-format -Wno-pointer-sign
windows: export CC = x86_64-w64-mingw32-gcc
windows: ../libmmapi.a $(BACKEND_LIB) $(WINDOWS_BACKENDS)
+# Optional target including the backends that require large dependencies
full: $(BACKEND_LIB) $(BACKENDS) $(OPTIONAL_BACKENDS)
+# Clean up all generated files
clean:
$(RM) $(BACKEND_LIB) $(BACKENDS) $(OPTIONAL_BACKENDS) $(WINDOWS_BACKENDS) $(MANUAL_BACKENDS)