-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
95 lines (72 loc) · 2.55 KB
/
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
CFLAGS_DEBUG = -g -fprofile-arcs -ftest-coverage -fPIC
CFLAGS = -std=c99 -pedantic -Wall -Wno-override-init-side-effects -Wno-unused-function -Werror $(CFLAGS_DEBUG)
SUB_ARCHIVES = events/events.a font/font.a element/element.a filedialog/filedialog.a ops/ops.a widgets/widgets.a checktag/checktag.a editor/editor.a editor_core/editor_core.a
.PHONY: all
all: main
.PHONY: run
run: render.so
.PHONY: runmain
runmain: main render.so
./main
.PHONY: clean
clean:
make -C events clean
make -C font clean
make -C widgets clean
make -C element clean
make -C checktag clean
make -C editor_core clean
make -C editor clean
make -C ops clean
make -C filedialog clean
find . -name '*.gcda' -delete
find . -name '*.gcno' -delete
rm -f nanovg.o
rm -f main
rm -f render.so
rm -f cimgui.a
nanovg.o: nanovg/src/nanovg.c
cc -c -std=c99 nanovg/src/nanovg.c
ds/libds.a:
make -C ./ds
font/font.a: force_look
$(MAKE) -C font PARENT_CFLAGS="$(CFLAGS)"
events/events.a: force_look
$(MAKE) -C events PARENT_CFLAGS="$(CFLAGS)"
widgets/widgets.a: force_look
$(MAKE) -C widgets PARENT_CFLAGS="$(CFLAGS)"
element/element.a: force_look
$(MAKE) -C element PARENT_CFLAGS="$(CFLAGS)"
ops/ops.a: force_look
$(MAKE) -C ops PARENT_CFLAGS="$(CFLAGS)"
filedialog/filedialog.a: force_look
$(MAKE) -C filedialog PARENT_CFLAGS="$(CFLAGS)"
checktag/checktag.a: force_look
$(MAKE) -C checktag PARENT_CFLAGS="$(CFLAGS)"
editor_core/editor_core.a: force_look
$(MAKE) -C editor_core PARENT_CFLAGS="$(CFLAGS)"
editor/editor.a: force_look
$(MAKE) -C editor PARENT_CFLAGS="$(CFLAGS)"
nanovg.a: nanovg.o
ar cr nanovg.a nanovg.o
cimgui.a: nanovg.a ds/libds.a $(SUB_ARCHIVES)
./merge_archives cimgui.a nanovg.a ds/libds.a $(SUB_ARCHIVES)
main: main.c application.c render.so cimgui.a
cc $(CFLAGS) $(shell pkg-config --cflags fontconfig gl glew glfw3 gtk+-3.0) -o main main.c application.c cimgui.a -lm $(shell pkg-config --libs fontconfig gl glew glfw3 gtk+-3.0) -ldl -rdynamic
render.so: render.c cimgui.a
cc $(CFLAGS) -shared -fPIC -o render.so render.c cimgui.a
.PHONY: test
test: cimgui.a clean-coverage
$(MAKE) -C test run_test;
# Remove all previous coverage data
.PHONY: clean-coverage
clean-coverage:
find . -name '*.gcda' -delete;
rm -f ./coverage/*
.PHONY: coverage
coverage: test
gcovr -s --html-details ./coverage/coverage.html --exclude-directories test -e main.c -e render.c -e font/utf8/test_utf8.c -e nanovg/src/nanovg_gl.h \
$(shell fd -E nativefiledialog -E ds -E md4c --print0 --glob 'test_*.c' | xargs --null printf " -e %s");
xdg-open ./coverage/coverage.html
force_look:
true