-
Notifications
You must be signed in to change notification settings - Fork 12
/
Makefile
35 lines (25 loc) · 876 Bytes
/
Makefile
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
DESTDIR ?=
PREFIX = /usr/local
CC ?= gcc
CFLAGS += -std=gnu99 -Wall -Wextra -Wshadow -Werror -fvisibility=hidden
LDFLAGS += -Wl,--no-undefined
ifeq ($(DEBUG),1)
CFLAGS += -O0 -g -DDEBUG
else
CFLAGS += -O2 -DNDEBUG
endif
all: ttymidi ttymidi.so
debug:
$(MAKE) DEBUG=1
ttymidi: src/ttymidi.c src/mod-semaphore.h
$(CC) $< $(CFLAGS) $(shell pkg-config --cflags --libs jack) $(LDFLAGS) -lpthread -o $@
ttymidi.so: src/ttymidi.c src/mod-semaphore.h
$(CC) $< $(CFLAGS) $(shell pkg-config --cflags --libs jack) $(LDFLAGS) -fPIC -lpthread -shared -o $@
install: ttymidi ttymidi.so
install -m 755 ttymidi $(DESTDIR)$(PREFIX)/bin/
install -m 755 ttymidi.so $(DESTDIR)$(shell pkg-config --variable=libdir jack)/jack/
clean:
rm -f ttymidi ttymidi.so
uninstall:
rm $(DESTDIR)$(PREFIX)/bin/ttymidi
rm $(DESTDIR)$(shell pkg-config --variable=libdir jack)/jack/ttymidi.so