aboutsummaryrefslogtreecommitdiffhomepage
path: root/makefile
diff options
context:
space:
mode:
authorcbdev <cb@cbcdn.com>2017-06-08 02:33:18 +0200
committercbdev <cb@cbcdn.com>2017-06-08 02:33:18 +0200
commitaed37425605d73ac22ec1f8c3145486d0ec79bb3 (patch)
treee99c68f889e3cd5fd23d00b3e6a81b50b36360b5 /makefile
parent804b5c3b3abbac7b95d79bf84fabbb78d94e2c39 (diff)
downloadmidimonster-aed37425605d73ac22ec1f8c3145486d0ec79bb3.tar.gz
midimonster-aed37425605d73ac22ec1f8c3145486d0ec79bb3.tar.bz2
midimonster-aed37425605d73ac22ec1f8c3145486d0ec79bb3.zip
Move to dynamically loading backends
Diffstat (limited to 'makefile')
-rw-r--r--makefile22
1 files changed, 16 insertions, 6 deletions
diff --git a/makefile b/makefile
index ec5238e..6819f7f 100644
--- a/makefile
+++ b/makefile
@@ -1,16 +1,26 @@
-LDLIBS = -lasound
-CFLAGS = -g -Wall
+.PHONY: clean
+BACKENDS = artnet.so midi.so osc.so
+OBJS = config.o backend.o plugin.o
+PLUGINDIR = "\"./\""
-BACKENDS = artnet.o midi.o osc.o
-OBJS = config.o backend.o $(BACKENDS)
+LDLIBS = -lasound -ldl
+CFLAGS ?= -g -Wall
-midimonster: midimonster.h $(OBJS)
+midimonster: CFLAGS += -rdynamic -DPLUGINS=$(PLUGINDIR)
+%.so: CFLAGS += -fPIC
+%.so: LDFLAGS += -shared
+
+%.so :: %.c %.h
+ $(CC) $(CFLAGS) $< -o $@ $(LDFLAGS)
-all: midimonster
+all: midimonster $(BACKENDS)
+
+midimonster: midimonster.h $(OBJS)
clean:
$(RM) midimonster
$(RM) $(OBJS)
+ $(RM) $(BACKENDS)
run:
valgrind --leak-check=full --show-leak-kinds=all ./midimonster