treewide: remove explicit rules for *offsets.s
[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 # 5) Generate constants.py (may need bounds.h)
10
11 #####
12 # 1) Generate bounds.h
13
14 bounds-file := include/generated/bounds.h
15
16 always  := $(bounds-file)
17 targets := kernel/bounds.s
18
19 $(obj)/$(bounds-file): kernel/bounds.s FORCE
20         $(call filechk,offsets,__LINUX_BOUNDS_H__)
21
22 #####
23 # 2) Generate timeconst.h
24
25 timeconst-file := include/generated/timeconst.h
26
27 targets += $(timeconst-file)
28
29 quiet_cmd_gentimeconst = GEN     $@
30 define cmd_gentimeconst
31         (echo $(CONFIG_HZ) | bc -q $< ) > $@
32 endef
33 define filechk_gentimeconst
34         (echo $(CONFIG_HZ) | bc -q $< )
35 endef
36
37 $(obj)/$(timeconst-file): kernel/time/timeconst.bc FORCE
38         $(call filechk,gentimeconst)
39
40 #####
41 # 3) Generate asm-offsets.h
42 #
43
44 offsets-file := include/generated/asm-offsets.h
45
46 always  += $(offsets-file)
47 targets += arch/$(SRCARCH)/kernel/asm-offsets.s
48
49 arch/$(SRCARCH)/kernel/asm-offsets.s: $(obj)/$(timeconst-file) $(obj)/$(bounds-file)
50
51 $(obj)/$(offsets-file): arch/$(SRCARCH)/kernel/asm-offsets.s FORCE
52         $(call filechk,offsets,__ASM_OFFSETS_H__)
53
54 #####
55 # 4) Check for missing system calls
56 #
57
58 always += missing-syscalls
59 targets += missing-syscalls
60
61 quiet_cmd_syscalls = CALL    $<
62       cmd_syscalls = $(CONFIG_SHELL) $< $(CC) $(c_flags) $(missing_syscalls_flags)
63
64 missing-syscalls: scripts/checksyscalls.sh $(offsets-file) FORCE
65         $(call cmd,syscalls)
66
67 #####
68 # 5) Generate constants for Python GDB integration
69 #
70
71 extra-$(CONFIG_GDB_SCRIPTS) += build_constants_py
72
73 build_constants_py: $(obj)/$(timeconst-file) $(obj)/$(bounds-file)
74         @$(MAKE) $(build)=scripts/gdb/linux $@
75
76 # Keep these three files during make clean
77 no-clean-files := $(bounds-file) $(offsets-file) $(timeconst-file)