aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile32
1 files changed, 32 insertions, 0 deletions
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..f4b03ae
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,32 @@
+CFLAGS = -Wall -Wextra -O0 -g -Iinclude
+
+.PHONY: all
+all:
+ mkdir -p build
+ $(CC) $(CFLAGS) src/server.c -o build/covsrv
+
+.PHONY: clean
+clean:
+ rm -rf build reports coverage vgcore.*
+
+build/pass: include/covsrv/covsrv.h src/client.c tests/pass.c
+ $(CC) $(CFLAGS) --coverage -DCOVERAGE=1 src/client.c tests/pass.c -o build/pass
+
+.PHONY: xpass
+.IGNORE: xpass
+xpass: build/pass
+ ./scripts/run-test build/pass
+
+build/fail: include/covsrv/covsrv.h src/client.c tests/fail.c
+ $(CC) $(CFLAGS) --coverage -DCOVERAGE=1 src/client.c tests/fail.c -o build/fail
+
+.PHONY: xfail
+.IGNORE: xfail
+xfail: build/fail
+ ./scripts/run-test build/fail
+
+.PHONY: check
+coverage: all xpass xfail
+ mkdir -p coverage
+ lcov --capture --directory . --out coverage/covsrv.info
+ genhtml coverage/covsrv.info --out coverage