-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.ninja
72 lines (54 loc) · 2.42 KB
/
build.ninja
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
cc = clang-10
llc = llc-10
objcopy = llvm-objcopy-10
objdump = llvm-objdump-10
rule cc_kernel
deps = gcc
depfile = $out.d
command = $cc -target bpf -isystem /usr/include/x86_64-linux-gnu -D__TARGET_ARCH_x86 -D__SANE_USERSPACE_TYPES__ -Wall -Wextra -Werror -emit-llvm -O2 -MD -MF $out.d -c $in -o $out
rule link_kernel
command = $llc -march=bpf -filetype=obj -o $out $in
rule cc_host
deps = gcc
depfile = $out.d
command = $cc -Wall -Wextra -Wpedantic -Werror -D__SANE_USERSPACE_TYPES__ -O2 -MD -MF $out.d -c $in -o $out
rule link_host
command = $cc $in -o $out
rule extract
command = $objcopy -O binary --only-section=.$out $in $out
rule header
command = xxd -i $in $out
rule objdump
command = $objdump -arch-name=bpf -S $in
rule format
command = clang-format-8 -i -style="{BasedOnStyle: llvm, ColumnLimit: 120}" *.h *.c
build format: format
build bpf.o: cc_host libbpf/bpf.c
build loader.o: cc_host loader.c
build symbolizer.o: cc_host symbolizer.c
build funclatency_kernel.o: cc_kernel funclatency_kernel.c
build funclatency_kernel.elf: link_kernel funclatency_kernel.o
build funclatency_entry: extract funclatency_kernel.elf
build funclatency_entry.h: header funclatency_entry
build funclatency_exit: extract funclatency_kernel.elf
build funclatency_exit.h: header funclatency_exit
build funclatency.o: cc_host funclatency.c | funclatency_entry.h funclatency_exit.h
build funclatency: link_host bpf.o loader.o funclatency.o
build memleak_kernel.o: cc_kernel memleak_kernel.c
build memleak_kernel.elf: link_kernel memleak_kernel.o
build malloc_entry: extract memleak_kernel.elf
build malloc_entry.h: header malloc_entry
build malloc_exit: extract memleak_kernel.elf
build malloc_exit.h: header malloc_exit
build free_entry: extract memleak_kernel.elf
build free_entry.h: header free_entry
build untracked_alloc_entry: extract memleak_kernel.elf
build untracked_alloc_entry.h: header untracked_alloc_entry
build memleak.o: cc_host memleak.c | malloc_entry.h malloc_exit.h free_entry.h untracked_alloc_entry.h
build memleak: link_host bpf.o loader.o memleak.o
build stackcount_kernel.o: cc_kernel stackcount_kernel.c
build stackcount_kernel.elf: link_kernel stackcount_kernel.o
build stackcount_entry: extract stackcount_kernel.elf
build stackcount_entry.h: header stackcount_entry
build stackcount.o: cc_host stackcount.c | stackcount_entry.h
build stackcount: link_host bpf.o loader.o symbolizer.o stackcount.o