]> git.ipfire.org Git - thirdparty/kernel/linux.git/blame - Kbuild
arch: remove redundant UAPI generic-y defines
[thirdparty/kernel/linux.git] / Kbuild
CommitLineData
b2441318 1# SPDX-License-Identifier: GPL-2.0
86feeaa8
SR
2#
3# Kbuild for top-level directory of the kernel
4# This file takes care of the following:
1cdf25d7 5# 1) Generate bounds.h
0a227985
NMG
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
f197d75f 9# 5) Generate constants.py (may need bounds.h)
86feeaa8 10
39664e2f
MY
11#####
12# 1) Generate bounds.h
13
14bounds-file := include/generated/bounds.h
15
16always := $(bounds-file)
8a58e162 17targets := kernel/bounds.s
39664e2f 18
11fda148 19$(bounds-file): kernel/bounds.s FORCE
70a4fd6c 20 $(call filechk,offsets,__LINUX_BOUNDS_H__)
1cdf25d7
CL
21
22#####
0a227985
NMG
23# 2) Generate timeconst.h
24
25timeconst-file := include/generated/timeconst.h
26
0a227985
NMG
27targets += $(timeconst-file)
28
0a227985 29define filechk_gentimeconst
ad774086 30 echo $(CONFIG_HZ) | bc -q $<
0a227985
NMG
31endef
32
11fda148 33$(timeconst-file): kernel/time/timeconst.bc FORCE
0a227985
NMG
34 $(call filechk,gentimeconst)
35
36#####
37# 3) Generate asm-offsets.h
86feeaa8
SR
38#
39
559df2e0 40offsets-file := include/generated/asm-offsets.h
86feeaa8 41
1cdf25d7 42always += $(offsets-file)
6752ed90 43targets += arch/$(SRCARCH)/kernel/asm-offsets.s
1cdf25d7 44
11fda148 45arch/$(SRCARCH)/kernel/asm-offsets.s: $(timeconst-file) $(bounds-file)
86feeaa8 46
11fda148 47$(offsets-file): arch/$(SRCARCH)/kernel/asm-offsets.s FORCE
70a4fd6c 48 $(call filechk,offsets,__ASM_OFFSETS_H__)
86feeaa8 49
c53aeca0 50#####
0a227985 51# 4) Check for missing system calls
c53aeca0
SR
52#
53
5f7efb4c
AL
54always += missing-syscalls
55targets += missing-syscalls
56
c53aeca0 57quiet_cmd_syscalls = CALL $<
44656fa0 58 cmd_syscalls = $(CONFIG_SHELL) $< $(CC) $(c_flags) $(missing_syscalls_flags)
c53aeca0 59
5f7efb4c 60missing-syscalls: scripts/checksyscalls.sh $(offsets-file) FORCE
c53aeca0 61 $(call cmd,syscalls)
1cdf25d7 62
f197d75f
KB
63#####
64# 5) Generate constants for Python GDB integration
65#
66
67extra-$(CONFIG_GDB_SCRIPTS) += build_constants_py
68
11fda148 69build_constants_py: $(timeconst-file) $(bounds-file)
f197d75f
KB
70 @$(MAKE) $(build)=scripts/gdb/linux $@
71
0a227985
NMG
72# Keep these three files during make clean
73no-clean-files := $(bounds-file) $(offsets-file) $(timeconst-file)