forked from zserge/partcl
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
31 lines (24 loc) · 732 Bytes
/
Makefile
File metadata and controls
31 lines (24 loc) · 732 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 ?= clang
CFLAGS ?= -Os -Wall -std=c99 -pedantic -DTCL_STANDALONE
LDFLAGS ?= -Os
TCLBIN := tcl
TEST_CC := clang
TEST_CFLAGS := -O0 -g -std=c11 -pedantic -fprofile-arcs -ftest-coverage -DTCL_TEST
TEST_LDFLAGS := $(TEST_CFLAGS)
TCLTESTBIN := tcl_test
all: $(TCLBIN) test
tcl: tcl.o tcllib.o
test: $(TCLTESTBIN)
./tcl_test
llvm-cov -gcda=tcl_test.gcda -gcno=tcl_test.gcno | grep "#####:"
$(TCLTESTBIN): tcl_test.o
$(TEST_CC) $(TEST_LDFLAGS) -o $@ $^
tcl_test.o: tcl_test.c tcllib.c \
tcl_test_lexer.h tcl_test_subst.h tcl_test_flow.h tcl_test_math.h
$(TEST_CC) $(TEST_CFLAGS) -c tcl_test.c -o $@
fmt:
clang-format-3.6 -i *.c *.h
cloc tcl.c
clean:
rm -f $(TCLBIN) $(TCLTESTBIN) *.o *.gcda *.gcno
.PHONY: test clean fmt