blob: 3109ac786e762565067a7b0087363b72e1d9f7f0 [file] [log] [blame]
Greg Kroah-Hartmanb2441312017-11-01 15:07:57 +01001# SPDX-License-Identifier: GPL-2.0
Sam Ravnborg86feeaa2005-09-09 19:28:28 +02002#
3# Kbuild for top-level directory of the kernel
Sam Ravnborg86feeaa2005-09-09 19:28:28 +02004
Masahiro Yamada39664e22015-01-05 15:57:15 +09005#####
Masahiro Yamada01d509a2019-02-19 18:33:03 +09006# Generate bounds.h
Masahiro Yamada39664e22015-01-05 15:57:15 +09007
8bounds-file := include/generated/bounds.h
9
10always := $(bounds-file)
Masahiro Yamada8a58e162015-03-26 20:59:52 +090011targets := kernel/bounds.s
Masahiro Yamada39664e22015-01-05 15:57:15 +090012
Masahiro Yamada11fda142018-12-22 18:50:35 +090013$(bounds-file): kernel/bounds.s FORCE
Michal Marek70a4fd62015-03-11 11:01:01 +010014 $(call filechk,offsets,__LINUX_BOUNDS_H__)
Masahiro Yamada39664e22015-01-05 15:57:15 +090015
16#####
Masahiro Yamada01d509a2019-02-19 18:33:03 +090017# Generate timeconst.h
Nicholas Mc Guire0a227982015-05-18 14:19:12 +020018
19timeconst-file := include/generated/timeconst.h
20
Masahiro Yamadaba97df42019-01-03 10:16:54 +090021filechk_gentimeconst = echo $(CONFIG_HZ) | bc -q $<
Nicholas Mc Guire0a227982015-05-18 14:19:12 +020022
Masahiro Yamada11fda142018-12-22 18:50:35 +090023$(timeconst-file): kernel/time/timeconst.bc FORCE
Nicholas Mc Guire0a227982015-05-18 14:19:12 +020024 $(call filechk,gentimeconst)
25
26#####
Masahiro Yamada01d509a2019-02-19 18:33:03 +090027# Generate asm-offsets.h
Masahiro Yamada39664e22015-01-05 15:57:15 +090028
29offsets-file := include/generated/asm-offsets.h
30
31always += $(offsets-file)
Masahiro Yamada39664e22015-01-05 15:57:15 +090032targets += arch/$(SRCARCH)/kernel/asm-offsets.s
33
Masahiro Yamada11fda142018-12-22 18:50:35 +090034arch/$(SRCARCH)/kernel/asm-offsets.s: $(timeconst-file) $(bounds-file)
Sam Ravnborg86feeaa2005-09-09 19:28:28 +020035
Masahiro Yamada11fda142018-12-22 18:50:35 +090036$(offsets-file): arch/$(SRCARCH)/kernel/asm-offsets.s FORCE
Michal Marek70a4fd62015-03-11 11:01:01 +010037 $(call filechk,offsets,__ASM_OFFSETS_H__)
Sam Ravnborg86feeaa2005-09-09 19:28:28 +020038
Sam Ravnborgc53aeca2007-03-27 22:50:29 +020039#####
Masahiro Yamada01d509a2019-02-19 18:33:03 +090040# Check for missing system calls
Sam Ravnborgc53aeca2007-03-27 22:50:29 +020041
Arnaud Lacombe5f7efb42011-08-24 21:03:30 -040042always += missing-syscalls
Arnaud Lacombe5f7efb42011-08-24 21:03:30 -040043
Sam Ravnborgc53aeca2007-03-27 22:50:29 +020044quiet_cmd_syscalls = CALL $<
David Daney44656fa2011-11-08 10:20:10 -080045 cmd_syscalls = $(CONFIG_SHELL) $< $(CC) $(c_flags) $(missing_syscalls_flags)
Sam Ravnborgc53aeca2007-03-27 22:50:29 +020046
Arnaud Lacombe5f7efb42011-08-24 21:03:30 -040047missing-syscalls: scripts/checksyscalls.sh $(offsets-file) FORCE
Sam Ravnborgc53aeca2007-03-27 22:50:29 +020048 $(call cmd,syscalls)
Christoph Lameter1cdf25d2008-04-28 02:12:44 -070049
Kieran Binghamf197d752016-05-23 16:24:40 -070050#####
Linus Torvaldsffd602e2019-03-10 17:48:21 -070051# Check atomic headers are up-to-date
Mark Rutland8d325882018-09-04 11:48:29 +010052
53always += old-atomics
Mark Rutland8d325882018-09-04 11:48:29 +010054
55quiet_cmd_atomics = CALL $<
Borislav Petkovbdf37b42018-11-08 20:41:28 +010056 cmd_atomics = $(CONFIG_SHELL) $<
Mark Rutland8d325882018-09-04 11:48:29 +010057
58old-atomics: scripts/atomic/check-atomics.sh FORCE
59 $(call cmd,atomics)