-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathMakefile
More file actions
30 lines (23 loc) · 749 Bytes
/
Copy pathMakefile
File metadata and controls
30 lines (23 loc) · 749 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
CFLAGS=-std=c89 -Wextra -Wall
TEST_SRC=$(CURDIR)/test/test.c $(CURDIR)/jWrite.c
COV_FILES=jWrite.c
TEST_OUT=$(CURDIR)/test/test.out
COV_OUT=$(CURDIR)/test/*.gcda $(CURDIR)/test/*.gcov $(CURDIR)/test/*.gcno
.PHONY: test_build
test_build: $(TEST_SRC)
cd test; pwd; gcc $(CFLAGS) $(TEST_SRC) -o $(TEST_OUT)
.PHONY: test
test: test_build $(TEST_OUT)
$(TEST_OUT)
.PHONY: test_cov_build
test_cov_build: $(TEST_SRC)
@cd test; gcc $(CFLAGS) -fprofile-arcs -ftest-coverage $(TEST_SRC) -o $(TEST_OUT) > /dev/null 2>&1
.PHONY: test_cov_run
test_cov_run: test_cov_build
@cd test; $(TEST_OUT) > /dev/null
.PHONY: test_cov
test_cov: test_clean test_cov_run
@cd test; gcov $(COV_FILES)
.PHONY: test_clean
test_clean:
@rm -f $(COV_OUT) $(TEST_OUT)