aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--Makefile32
-rw-r--r--backends/Makefile17
-rw-r--r--backends/artnet.c (renamed from artnet.c)0
-rw-r--r--backends/artnet.h (renamed from artnet.h)0
-rw-r--r--backends/evdev.c (renamed from evdev.c)0
-rw-r--r--backends/evdev.h (renamed from evdev.h)0
-rw-r--r--backends/loopback.c (renamed from loopback.c)0
-rw-r--r--backends/loopback.h (renamed from loopback.h)0
-rw-r--r--backends/midi.c (renamed from midi.c)0
-rw-r--r--backends/midi.h (renamed from midi.h)0
-rw-r--r--backends/osc.c (renamed from osc.c)0
-rw-r--r--backends/osc.h (renamed from osc.h)0
-rw-r--r--backends/sacn.c (renamed from sacn.c)0
-rw-r--r--backends/sacn.h (renamed from sacn.h)0
14 files changed, 29 insertions, 20 deletions
diff --git a/Makefile b/Makefile
index 5f403ac..4a85eab 100644
--- a/Makefile
+++ b/Makefile
@@ -1,36 +1,28 @@
-.PHONY: all clean run sanitize
-BACKENDS = artnet.so midi.so osc.so loopback.so evdev.so sacn.so
+.PHONY: all clean run sanitize backends
OBJS = config.o backend.o plugin.o
-PLUGINDIR = "\"./\""
+PLUGINDIR = "\"./backends/\""
CFLAGS ?= -g -Wall
+LDLIBS = -ldl
+CFLAGS += -DPLUGINS=$(PLUGINDIR)
#CFLAGS += -DDEBUG
-%.so: CFLAGS += -fPIC
-%.so: LDFLAGS += -shared
+LDFLAGS += -Wl,-export-dynamic
-midimonster: LDLIBS = -ldl
-midimonster: CFLAGS += -DPLUGINS=$(PLUGINDIR)
-midimonster: LDFLAGS += -Wl,-export-dynamic
-midi.so: LDLIBS = -lasound
-evdev.so: CFLAGS += $(shell pkg-config --cflags libevdev)
-evdev.so: LDLIBS = $(shell pkg-config --libs libevdev)
+all: midimonster backends
-
-%.so :: %.c %.h
- $(CC) $(CFLAGS) $(LDLIBS) $< -o $@ $(LDFLAGS)
-
-all: midimonster $(BACKENDS)
+backends:
+ $(MAKE) -C backends
midimonster: midimonster.c $(OBJS)
clean:
$(RM) midimonster
$(RM) $(OBJS)
- $(RM) $(BACKENDS)
+ $(MAKE) -C backends clean
run:
valgrind --leak-check=full --show-leak-kinds=all ./midimonster
-sanitize: CC = clang
-sanitize: CFLAGS = -g -Wall -Wpedantic -fsanitize=address -fsanitize=undefined -fno-omit-frame-pointer
-sanitize: midimonster $(BACKENDS)
+sanitize: export CC = clang
+sanitize: export CFLAGS = -g -Wall -Wpedantic -fsanitize=address -fsanitize=undefined -fno-omit-frame-pointer
+sanitize: midimonster backends
diff --git a/backends/Makefile b/backends/Makefile
new file mode 100644
index 0000000..85fe152
--- /dev/null
+++ b/backends/Makefile
@@ -0,0 +1,17 @@
+.PHONY: all clean
+BACKENDS = artnet.so midi.so osc.so loopback.so evdev.so sacn.so
+
+CFLAGS += -fPIC -I../
+LDFLAGS += -shared
+
+midi.so: LDLIBS = -lasound
+evdev.so: CFLAGS += $(shell pkg-config --cflags libevdev)
+evdev.so: LDLIBS = $(shell pkg-config --libs libevdev)
+
+%.so :: %.c %.h
+ $(CC) $(CFLAGS) $(LDLIBS) $< -o $@ $(LDFLAGS)
+
+all: $(BACKENDS)
+
+clean:
+ $(RM) $(BACKENDS)
diff --git a/artnet.c b/backends/artnet.c
index c16e630..c16e630 100644
--- a/artnet.c
+++ b/backends/artnet.c
diff --git a/artnet.h b/backends/artnet.h
index 90aedd5..90aedd5 100644
--- a/artnet.h
+++ b/backends/artnet.h
diff --git a/evdev.c b/backends/evdev.c
index ac63850..ac63850 100644
--- a/evdev.c
+++ b/backends/evdev.c
diff --git a/evdev.h b/backends/evdev.h
index 89a08ae..89a08ae 100644
--- a/evdev.h
+++ b/backends/evdev.h
diff --git a/loopback.c b/backends/loopback.c
index bb93a1f..bb93a1f 100644
--- a/loopback.c
+++ b/backends/loopback.c
diff --git a/loopback.h b/backends/loopback.h
index fe44e91..fe44e91 100644
--- a/loopback.h
+++ b/backends/loopback.h
diff --git a/midi.c b/backends/midi.c
index d856ced..d856ced 100644
--- a/midi.c
+++ b/backends/midi.c
diff --git a/midi.h b/backends/midi.h
index 556706f..556706f 100644
--- a/midi.h
+++ b/backends/midi.h
diff --git a/osc.c b/backends/osc.c
index adc91f5..adc91f5 100644
--- a/osc.c
+++ b/backends/osc.c
diff --git a/osc.h b/backends/osc.h
index 5938f12..5938f12 100644
--- a/osc.h
+++ b/backends/osc.h
diff --git a/sacn.c b/backends/sacn.c
index 9a3202d..9a3202d 100644
--- a/sacn.c
+++ b/backends/sacn.c
diff --git a/sacn.h b/backends/sacn.h
index e7106f7..e7106f7 100644
--- a/sacn.h
+++ b/backends/sacn.h