scripts/gdb: delay generation of gdb constants.py
[linux-2.6-block.git] / Kbuild
1 # SPDX-License-Identifier: GPL-2.0
2 #
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
10 #####
11 # 1) Generate bounds.h
12
13 bounds-file := include/generated/bounds.h
14
15 always  := $(bounds-file)
16 targets := kernel/bounds.s
17
18 $(bounds-file): kernel/bounds.s FORCE
19         $(call filechk,offsets,__LINUX_BOUNDS_H__)
20
21 #####
22 # 2) Generate timeconst.h
23
24 timeconst-file := include/generated/timeconst.h
25
26 targets += $(timeconst-file)
27
28 filechk_gentimeconst = echo $(CONFIG_HZ) | bc -q $<
29
30 $(timeconst-file): kernel/time/timeconst.bc FORCE
31         $(call filechk,gentimeconst)
32
33 #####
34 # 3) Generate asm-offsets.h
35 #
36
37 offsets-file := include/generated/asm-offsets.h
38
39 always  += $(offsets-file)
40 targets += arch/$(SRCARCH)/kernel/asm-offsets.s
41
42 arch/$(SRCARCH)/kernel/asm-offsets.s: $(timeconst-file) $(bounds-file)
43
44 $(offsets-file): arch/$(SRCARCH)/kernel/asm-offsets.s FORCE
45         $(call filechk,offsets,__ASM_OFFSETS_H__)
46
47 #####
48 # 4) Check for missing system calls
49 #
50
51 always += missing-syscalls
52 targets += missing-syscalls
53
54 quiet_cmd_syscalls = CALL    $<
55       cmd_syscalls = $(CONFIG_SHELL) $< $(CC) $(c_flags) $(missing_syscalls_flags)
56
57 missing-syscalls: scripts/checksyscalls.sh $(offsets-file) FORCE
58         $(call cmd,syscalls)
59
60 # Keep these three files during make clean
61 no-clean-files := $(bounds-file) $(offsets-file) $(timeconst-file)