Source
1
1
# SPDX-License-Identifier: GPL-2.0
2
2
#
3
3
# Kbuild for top-level directory of the kernel
4
-
# This file takes care of the following:
5
-
# 1) Generate bounds.h
6
-
# 2) Generate timeconst.h
7
-
# 3) Generate asm-offsets.h (may need bounds.h and timeconst.h)
8
-
# 4) Check for missing system calls
9
4
10
5
#####
11
-
# 1) Generate bounds.h
6
+
# Generate bounds.h
12
7
13
8
bounds-file := include/generated/bounds.h
14
9
15
10
always := $(bounds-file)
16
11
targets := kernel/bounds.s
17
12
18
13
$(bounds-file): kernel/bounds.s FORCE
19
14
$(call filechk,offsets,__LINUX_BOUNDS_H__)
20
15
21
16
#####
22
-
# 2) Generate timeconst.h
17
+
# Generate timeconst.h
23
18
24
19
timeconst-file := include/generated/timeconst.h
25
20
26
21
targets += $(timeconst-file)
27
22
28
23
filechk_gentimeconst = echo $(CONFIG_HZ) | bc -q $<
29
24
30
25
$(timeconst-file): kernel/time/timeconst.bc FORCE
31
26
$(call filechk,gentimeconst)
32
27
33
28
#####
34
-
# 3) Generate asm-offsets.h
35
-
#
29
+
# Generate asm-offsets.h
36
30
37
31
offsets-file := include/generated/asm-offsets.h
38
32
39
33
always += $(offsets-file)
40
34
targets += arch/$(SRCARCH)/kernel/asm-offsets.s
41
35
42
36
arch/$(SRCARCH)/kernel/asm-offsets.s: $(timeconst-file) $(bounds-file)
43
37
44
38
$(offsets-file): arch/$(SRCARCH)/kernel/asm-offsets.s FORCE
45
39
$(call filechk,offsets,__ASM_OFFSETS_H__)
46
40
47
41
#####
48
-
# 4) Check for missing system calls
49
-
#
42
+
# Check for missing system calls
50
43
51
44
always += missing-syscalls
52
45
targets += missing-syscalls
53
46
54
47
quiet_cmd_syscalls = CALL $<
55
48
cmd_syscalls = $(CONFIG_SHELL) $< $(CC) $(c_flags) $(missing_syscalls_flags)
56
49
57
50
missing-syscalls: scripts/checksyscalls.sh $(offsets-file) FORCE
58
51
$(call cmd,syscalls)
59
52