Greg Kroah-Hartman | b244131 | 2017-11-01 15:07:57 +0100 | [diff] [blame] | 1 | # SPDX-License-Identifier: GPL-2.0 |
Sam Ravnborg | 86feeaa | 2005-09-09 19:28:28 +0200 | [diff] [blame] | 2 | # |
3 | # Kbuild for top-level directory of the kernel | ||||
Sam Ravnborg | 86feeaa | 2005-09-09 19:28:28 +0200 | [diff] [blame] | 4 | |
Masahiro Yamada | 39664e2 | 2015-01-05 15:57:15 +0900 | [diff] [blame] | 5 | ##### |
Masahiro Yamada | 01d509a | 2019-02-19 18:33:03 +0900 | [diff] [blame] | 6 | # Generate bounds.h |
Masahiro Yamada | 39664e2 | 2015-01-05 15:57:15 +0900 | [diff] [blame] | 7 | |
8 | bounds-file := include/generated/bounds.h | ||||
9 | |||||
Masahiro Yamada | 5f2fb52 | 2020-02-02 01:49:24 +0900 | [diff] [blame] | 10 | always-y := $(bounds-file) |
Masahiro Yamada | 8a58e16 | 2015-03-26 20:59:52 +0900 | [diff] [blame] | 11 | targets := kernel/bounds.s |
Masahiro Yamada | 39664e2 | 2015-01-05 15:57:15 +0900 | [diff] [blame] | 12 | |
Masahiro Yamada | 11fda14 | 2018-12-22 18:50:35 +0900 | [diff] [blame] | 13 | $(bounds-file): kernel/bounds.s FORCE |
Michal Marek | 70a4fd6 | 2015-03-11 11:01:01 +0100 | [diff] [blame] | 14 | $(call filechk,offsets,__LINUX_BOUNDS_H__) |
Masahiro Yamada | 39664e2 | 2015-01-05 15:57:15 +0900 | [diff] [blame] | 15 | |
16 | ##### | ||||
Masahiro Yamada | 01d509a | 2019-02-19 18:33:03 +0900 | [diff] [blame] | 17 | # Generate timeconst.h |
Nicholas Mc Guire | 0a22798 | 2015-05-18 14:19:12 +0200 | [diff] [blame] | 18 | |
19 | timeconst-file := include/generated/timeconst.h | ||||
20 | |||||
Masahiro Yamada | ba97df4 | 2019-01-03 10:16:54 +0900 | [diff] [blame] | 21 | filechk_gentimeconst = echo $(CONFIG_HZ) | bc -q $< |
Nicholas Mc Guire | 0a22798 | 2015-05-18 14:19:12 +0200 | [diff] [blame] | 22 | |
Masahiro Yamada | 11fda14 | 2018-12-22 18:50:35 +0900 | [diff] [blame] | 23 | $(timeconst-file): kernel/time/timeconst.bc FORCE |
Nicholas Mc Guire | 0a22798 | 2015-05-18 14:19:12 +0200 | [diff] [blame] | 24 | $(call filechk,gentimeconst) |
25 | |||||
26 | ##### | ||||
Masahiro Yamada | 01d509a | 2019-02-19 18:33:03 +0900 | [diff] [blame] | 27 | # Generate asm-offsets.h |
Masahiro Yamada | 39664e2 | 2015-01-05 15:57:15 +0900 | [diff] [blame] | 28 | |
29 | offsets-file := include/generated/asm-offsets.h | ||||
30 | |||||
Masahiro Yamada | 5f2fb52 | 2020-02-02 01:49:24 +0900 | [diff] [blame] | 31 | always-y += $(offsets-file) |
Masahiro Yamada | 39664e2 | 2015-01-05 15:57:15 +0900 | [diff] [blame] | 32 | targets += arch/$(SRCARCH)/kernel/asm-offsets.s |
33 | |||||
Masahiro Yamada | 11fda14 | 2018-12-22 18:50:35 +0900 | [diff] [blame] | 34 | arch/$(SRCARCH)/kernel/asm-offsets.s: $(timeconst-file) $(bounds-file) |
Sam Ravnborg | 86feeaa | 2005-09-09 19:28:28 +0200 | [diff] [blame] | 35 | |
Masahiro Yamada | 11fda14 | 2018-12-22 18:50:35 +0900 | [diff] [blame] | 36 | $(offsets-file): arch/$(SRCARCH)/kernel/asm-offsets.s FORCE |
Michal Marek | 70a4fd6 | 2015-03-11 11:01:01 +0100 | [diff] [blame] | 37 | $(call filechk,offsets,__ASM_OFFSETS_H__) |
Sam Ravnborg | 86feeaa | 2005-09-09 19:28:28 +0200 | [diff] [blame] | 38 | |
Sam Ravnborg | c53aeca | 2007-03-27 22:50:29 +0200 | [diff] [blame] | 39 | ##### |
Masahiro Yamada | 01d509a | 2019-02-19 18:33:03 +0900 | [diff] [blame] | 40 | # Check for missing system calls |
Sam Ravnborg | c53aeca | 2007-03-27 22:50:29 +0200 | [diff] [blame] | 41 | |
Masahiro Yamada | 5f2fb52 | 2020-02-02 01:49:24 +0900 | [diff] [blame] | 42 | always-y += missing-syscalls |
Arnaud Lacombe | 5f7efb4 | 2011-08-24 21:03:30 -0400 | [diff] [blame] | 43 | |
Sam Ravnborg | c53aeca | 2007-03-27 22:50:29 +0200 | [diff] [blame] | 44 | quiet_cmd_syscalls = CALL $< |
David Daney | 44656fa | 2011-11-08 10:20:10 -0800 | [diff] [blame] | 45 | cmd_syscalls = $(CONFIG_SHELL) $< $(CC) $(c_flags) $(missing_syscalls_flags) |
Sam Ravnborg | c53aeca | 2007-03-27 22:50:29 +0200 | [diff] [blame] | 46 | |
Arnaud Lacombe | 5f7efb4 | 2011-08-24 21:03:30 -0400 | [diff] [blame] | 47 | missing-syscalls: scripts/checksyscalls.sh $(offsets-file) FORCE |
Sam Ravnborg | c53aeca | 2007-03-27 22:50:29 +0200 | [diff] [blame] | 48 | $(call cmd,syscalls) |
Christoph Lameter | 1cdf25d | 2008-04-28 02:12:44 -0700 | [diff] [blame] | 49 | |
Kieran Bingham | f197d75 | 2016-05-23 16:24:40 -0700 | [diff] [blame] | 50 | ##### |
Linus Torvalds | ffd602e | 2019-03-10 17:48:21 -0700 | [diff] [blame] | 51 | # Check atomic headers are up-to-date |
Mark Rutland | 8d32588 | 2018-09-04 11:48:29 +0100 | [diff] [blame] | 52 | |
Masahiro Yamada | 5f2fb52 | 2020-02-02 01:49:24 +0900 | [diff] [blame] | 53 | always-y += old-atomics |
Mark Rutland | 8d32588 | 2018-09-04 11:48:29 +0100 | [diff] [blame] | 54 | |
55 | quiet_cmd_atomics = CALL $< | ||||
Borislav Petkov | bdf37b4 | 2018-11-08 20:41:28 +0100 | [diff] [blame] | 56 | cmd_atomics = $(CONFIG_SHELL) $< |
Mark Rutland | 8d32588 | 2018-09-04 11:48:29 +0100 | [diff] [blame] | 57 | |
58 | old-atomics: scripts/atomic/check-atomics.sh FORCE | ||||
59 | $(call cmd,atomics) |