1b2441318SGreg Kroah-Hartman# SPDX-License-Identifier: GPL-2.0
286feeaa8SSam Ravnborg#
386feeaa8SSam Ravnborg# Kbuild for top-level directory of the kernel
486feeaa8SSam Ravnborg
539664e2fSMasahiro Yamada#####
601d509a4SMasahiro Yamada# Generate bounds.h
739664e2fSMasahiro Yamada
839664e2fSMasahiro Yamadabounds-file := include/generated/bounds.h
939664e2fSMasahiro Yamada
105f2fb52fSMasahiro Yamadaalways-y := $(bounds-file)
118a58e162SMasahiro Yamadatargets := kernel/bounds.s
1239664e2fSMasahiro Yamada
1311fda148SMasahiro Yamada$(bounds-file): kernel/bounds.s FORCE
1470a4fd6cSMichal Marek	$(call filechk,offsets,__LINUX_BOUNDS_H__)
151cdf25d7SChristoph Lameter
161cdf25d7SChristoph Lameter#####
1701d509a4SMasahiro Yamada# Generate timeconst.h
180a227985SNicholas Mc Guire
190a227985SNicholas Mc Guiretimeconst-file := include/generated/timeconst.h
200a227985SNicholas Mc Guire
21ba97df45SMasahiro Yamadafilechk_gentimeconst = echo $(CONFIG_HZ) | bc -q $<
220a227985SNicholas Mc Guire
2311fda148SMasahiro Yamada$(timeconst-file): kernel/time/timeconst.bc FORCE
240a227985SNicholas Mc Guire	$(call filechk,gentimeconst)
250a227985SNicholas Mc Guire
260a227985SNicholas Mc Guire#####
2701d509a4SMasahiro Yamada# Generate asm-offsets.h
2886feeaa8SSam Ravnborg
29559df2e0SSam Ravnborgoffsets-file := include/generated/asm-offsets.h
3086feeaa8SSam Ravnborg
315f2fb52fSMasahiro Yamadaalways-y += $(offsets-file)
326752ed90SThomas Gleixnertargets += arch/$(SRCARCH)/kernel/asm-offsets.s
331cdf25d7SChristoph Lameter
3411fda148SMasahiro Yamadaarch/$(SRCARCH)/kernel/asm-offsets.s: $(timeconst-file) $(bounds-file)
3586feeaa8SSam Ravnborg
3611fda148SMasahiro Yamada$(offsets-file): arch/$(SRCARCH)/kernel/asm-offsets.s FORCE
3770a4fd6cSMichal Marek	$(call filechk,offsets,__ASM_OFFSETS_H__)
3886feeaa8SSam Ravnborg
39c53aeca0SSam Ravnborg#####
4001d509a4SMasahiro Yamada# Check for missing system calls
41c53aeca0SSam Ravnborg
425f2fb52fSMasahiro Yamadaalways-y += missing-syscalls
435f7efb4cSArnaud Lacombe
44c53aeca0SSam Ravnborgquiet_cmd_syscalls = CALL    $<
4544656fa0SDavid Daney      cmd_syscalls = $(CONFIG_SHELL) $< $(CC) $(c_flags) $(missing_syscalls_flags)
46c53aeca0SSam Ravnborg
475f7efb4cSArnaud Lacombemissing-syscalls: scripts/checksyscalls.sh $(offsets-file) FORCE
48c53aeca0SSam Ravnborg	$(call cmd,syscalls)
491cdf25d7SChristoph Lameter
50f197d75fSKieran Bingham#####
51ffd602ebSLinus Torvalds# Check atomic headers are up-to-date
528d325880SMark Rutland
535f2fb52fSMasahiro Yamadaalways-y += old-atomics
548d325880SMark Rutland
558d325880SMark Rutlandquiet_cmd_atomics = CALL    $<
56bdf37b4dSBorislav Petkov      cmd_atomics = $(CONFIG_SHELL) $<
578d325880SMark Rutland
588d325880SMark Rutlandold-atomics: scripts/atomic/check-atomics.sh FORCE
598d325880SMark Rutland	$(call cmd,atomics)
60