-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
31 lines (22 loc) · 890 Bytes
/
Makefile
File metadata and controls
31 lines (22 loc) · 890 Bytes
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
CC = gcc
CFLAGS = -Wall -Wextra -O2
LDFLAGS = -lm
ifeq ($(COVERAGE),1)
CFLAGS += --coverage -g -O0
LDFLAGS += --coverage
endif
.PHONY: all clean test c_tests test_unity
all: inference
inference: src/c/inference.c src/c/inference.h
$(CC) $(CFLAGS) -o $@ $< $(LDFLAGS)
test_inference: src/c/test_inference.c
$(CC) $(CFLAGS) -o $@ $< $(LDFLAGS)
tests/c/test_inference_unity: tests/c/test_inference_unity.c src/c/inference.c src/c/inference.h tests/c/unity/unity.c tests/c/unity/unity.h
$(CC) $(CFLAGS) -I./src/c -I./tests/c/unity -DTINY_ML_INFERENCE_NO_MAIN -o $@ tests/c/test_inference_unity.c src/c/inference.c tests/c/unity/unity.c $(LDFLAGS)
c_tests: test_inference tests/c/test_inference_unity
./test_inference
./tests/c/test_inference_unity
test: c_tests
clean:
rm -f inference test_inference tests/c/test_inference_unity *.o
rm -f *.gcno *.gcda coverage.info