diff options
author | cbdev <cb@cbcdn.com> | 2018-03-02 03:20:11 +0100 |
---|---|---|
committer | cbdev <cb@cbcdn.com> | 2018-03-02 03:20:11 +0100 |
commit | 2dfc564edc0c89c4a8de7e384806aae5d593426d (patch) | |
tree | b1636ec14d3f35ed88b3f079e0c3d168f77b17b9 | |
parent | be5df1c4e639ca6a7cd70a3122039a1de4588e28 (diff) | |
download | midimonster-2dfc564edc0c89c4a8de7e384806aae5d593426d.tar.gz midimonster-2dfc564edc0c89c4a8de7e384806aae5d593426d.tar.bz2 midimonster-2dfc564edc0c89c4a8de7e384806aae5d593426d.zip |
Move backend implementations to subdirectory
-rw-r--r-- | Makefile | 32 | ||||
-rw-r--r-- | backends/Makefile | 17 | ||||
-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
@@ -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 |