-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathMakefile
37 lines (25 loc) · 1.12 KB
/
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
36
37
CFLAGS = -std=c99 -g -MMD -pedantic -W -Wall -Wno-variadic-macros -Waggregate-return -Wbad-function-cast -Wcast-align -Wcast-qual -Wdisabled-optimization -Wendif-labels -Wfloat-equal -Winline -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wredundant-decls -Wshadow -Wsign-compare -Wstrict-prototypes -Wundef -Wwrite-strings
LDFLAGS =
LDLIBS = -lasound -lsndfile
exes = send-sds receive-sds
deps = $(addsuffix .d,$(basename $(wildcard *.c)))
libobjs = common.o err.o midi.o sds.o
libfile = libsds.a
dockertag = bsorahan/send-sds
all: $(exes)
$(libfile): $(libobjs)
$(AR) crs $@ $^
$(exes): $(libfile)
$(CC) $(CFLAGS) -o $@ $@.c $(libfile) $(LDFLAGS) $(LDLIBS)
clean:
-$(RM) $(exes) $(tests) $(deps) $(libfile) $(libobjs) *.log *~
image:
docker build -t $(dockertag) .
check: $(basename $(wildcard test-*.c))
@for test in $^ ; do ./$$test && echo PASS: $$test || echo FAIL: $$test >&2 ; done
test-err: test-err.c err.o err.h
$(CC) $(CFLAGS) -o $@ $@.c err.o
test-midi: test-midi.c $(libfile)
$(CC) $(CFLAGS) -o $@ $@.c $(libfile) $(LDFLAGS) $(LDLIBS)
.PHONY: all clean image
-include $(deps)