aboutsummaryrefslogtreecommitdiffhomepage
path: root/makefile
diff options
context:
space:
mode:
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