From aed37425605d73ac22ec1f8c3145486d0ec79bb3 Mon Sep 17 00:00:00 2001 From: cbdev Date: Thu, 8 Jun 2017 02:33:18 +0200 Subject: Move to dynamically loading backends --- makefile | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) (limited to 'makefile') 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 -- cgit v1.2.3