aboutsummaryrefslogtreecommitdiffhomepage
path: root/Makefile
blob: 5f403ac110a80489f0ebde959bc8ed065ad00f95 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
.PHONY: all clean run sanitize
BACKENDS = artnet.so midi.so osc.so loopback.so evdev.so sacn.so
OBJS = config.o backend.o plugin.o
PLUGINDIR = "\"./\""

CFLAGS ?= -g -Wall
#CFLAGS += -DDEBUG
%.so: CFLAGS += -fPIC
%.so: LDFLAGS += -shared

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)


%.so :: %.c %.h
	$(CC) $(CFLAGS) $(LDLIBS) $< -o $@ $(LDFLAGS)

all: midimonster $(BACKENDS)

midimonster: midimonster.c $(OBJS)

clean:
	$(RM) midimonster
	$(RM) $(OBJS)
	$(RM) $(BACKENDS)

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)