-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
82 lines (64 loc) · 1.51 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
.PHONY: all
all: setup
$(MAKE) -f scripts/makefile
.PHONY: check
check: all
$(MAKE) -C tests check
.PHONY: benchmark
benchmark: all
$(MAKE) -C benchmarks benchmark
# this kicks all unrecognised targets to the client script.
# note that trying to compile individual files, e.g.
#
# make kernel.elf
#
# will not work, you would need
#
# make -f scripts/makefile kernel.elf
#
# instead
.DEFAULT: setup
$(MAKE) -f scripts/makefile $<
.PHONY:
setup:
@echo -n > deps.mk
@./scripts/gen-deps -p KERNEL -c COMPILE_KERNEL -b kernel "${KERNEL_SOURCES}"
# default values, overwrite if/when needed
ARCH ?= riscv64
ARCH_SOURCE = arch/$(ARCH)
KERNEL_SOURCES != echo src/*.c src/uapi/*.c lib/*.c
CLEANUP := build deps.mk kmi.elf kmi.bin
CLEANUP_CMD :=
include arch/$(ARCH)/source.mk
.PHONY: format
format:
find arch lib src include -iname '*.[ch]' |\
xargs uncrustify -c uncrustify.conf --no-backup -F -
.PHONY: license
license:
find arch lib src include -iname '*.[ch]' |\
xargs ./scripts/license
.PHONY: docs
docs:
find arch lib src include -iname '*.[ch]' -not -path */gen/* |\
xargs ./scripts/warn-undocumented
doxygen docs/doxygen.conf
RM = rm
.PHONY: clean
clean:
$(MAKE) -C tests clean
$(RM) -rf $(CLEANUP)
.PHONY: clean_tests
clean_tests:
$(MAKE) -C tests clean
.PHONY: clean_benchmarks
clean_benchmarks:
$(MAKE) -C benchmarks clean
.PHONY: clean_run
clean_run:
$(CLEANUP_CMD)
.PHONY: clean_docs
clean_docs:
$(RM) -rf docs/output
.PHONY: clean_all
clean_all: clean clean_run clean_docs clean_tests clean_benchmarks