forked from watson/libmodes
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
32 lines (24 loc) · 765 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
INCLUDE = ./include
CFLAGS ?= -O2 -g -Wall -W
LDFLAGS += -lpthread -lm
CC ?= gcc
test_file := tests/test
test_fixtires_dir := tests/fixtures
test_results := tests/results
.PHONY: all test clean
.DELETE_ON_ERROR:
all: $(test_file)
%.o: %.c
$(CC) -c $(CFLAGS) -I${INCLUDE} $^ -o $@
$(test_file): tests/test.o src/mode-s.o
$(CC) ${CFLAGS} $^ ${LDFLAGS} -o $@
test: $(test_results)
$(test_results): $(test_file)
if [ ! -d "$(test_fixtires_dir)" ]; then \
git clone --depth=1 https://github.com/watson/libmodes-test-fixtures.git $(test_fixtires_dir); \
else \
(cd $(test_fixtires_dir) && git pull --depth=1 origin master); \
fi
$(test_file) $(test_fixtires_dir)/dump.bin | tee $@
clean:
rm -fr **/*.o $(test_file) $(test_fixtires_dir) $(test_results)