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 | |
| 10 | always := $(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 | |
Nicholas Mc Guire | 0a22798 | 2015-05-18 14:19:12 +0200 | [diff] [blame] | 21 | targets += $(timeconst-file) |
| 22 | |
Masahiro Yamada | ba97df4 | 2019-01-03 10:16:54 +0900 | [diff] [blame] | 23 | filechk_gentimeconst = echo $(CONFIG_HZ) | bc -q $< |
Nicholas Mc Guire | 0a22798 | 2015-05-18 14:19:12 +0200 | [diff] [blame] | 24 | |
Masahiro Yamada | 11fda14 | 2018-12-22 18:50:35 +0900 | [diff] [blame] | 25 | $(timeconst-file): kernel/time/timeconst.bc FORCE |
Nicholas Mc Guire | 0a22798 | 2015-05-18 14:19:12 +0200 | [diff] [blame] | 26 | $(call filechk,gentimeconst) |
| 27 | |
| 28 | ##### |
Masahiro Yamada | 01d509a | 2019-02-19 18:33:03 +0900 | [diff] [blame] | 29 | # Generate asm-offsets.h |
Masahiro Yamada | 39664e2 | 2015-01-05 15:57:15 +0900 | [diff] [blame] | 30 | |
| 31 | offsets-file := include/generated/asm-offsets.h |
| 32 | |
| 33 | always += $(offsets-file) |
Masahiro Yamada | 39664e2 | 2015-01-05 15:57:15 +0900 | [diff] [blame] | 34 | targets += arch/$(SRCARCH)/kernel/asm-offsets.s |
| 35 | |
Masahiro Yamada | 11fda14 | 2018-12-22 18:50:35 +0900 | [diff] [blame] | 36 | arch/$(SRCARCH)/kernel/asm-offsets.s: $(timeconst-file) $(bounds-file) |
Sam Ravnborg | 86feeaa | 2005-09-09 19:28:28 +0200 | [diff] [blame] | 37 | |
Masahiro Yamada | 11fda14 | 2018-12-22 18:50:35 +0900 | [diff] [blame] | 38 | $(offsets-file): arch/$(SRCARCH)/kernel/asm-offsets.s FORCE |
Michal Marek | 70a4fd6 | 2015-03-11 11:01:01 +0100 | [diff] [blame] | 39 | $(call filechk,offsets,__ASM_OFFSETS_H__) |
Sam Ravnborg | 86feeaa | 2005-09-09 19:28:28 +0200 | [diff] [blame] | 40 | |
Sam Ravnborg | c53aeca | 2007-03-27 22:50:29 +0200 | [diff] [blame] | 41 | ##### |
Masahiro Yamada | 01d509a | 2019-02-19 18:33:03 +0900 | [diff] [blame] | 42 | # Check for missing system calls |
Sam Ravnborg | c53aeca | 2007-03-27 22:50:29 +0200 | [diff] [blame] | 43 | |
Arnaud Lacombe | 5f7efb4 | 2011-08-24 21:03:30 -0400 | [diff] [blame] | 44 | always += missing-syscalls |
| 45 | targets += missing-syscalls |
| 46 | |
Sam Ravnborg | c53aeca | 2007-03-27 22:50:29 +0200 | [diff] [blame] | 47 | quiet_cmd_syscalls = CALL $< |
David Daney | 44656fa | 2011-11-08 10:20:10 -0800 | [diff] [blame] | 48 | cmd_syscalls = $(CONFIG_SHELL) $< $(CC) $(c_flags) $(missing_syscalls_flags) |
Sam Ravnborg | c53aeca | 2007-03-27 22:50:29 +0200 | [diff] [blame] | 49 | |
Arnaud Lacombe | 5f7efb4 | 2011-08-24 21:03:30 -0400 | [diff] [blame] | 50 | missing-syscalls: scripts/checksyscalls.sh $(offsets-file) FORCE |
Sam Ravnborg | c53aeca | 2007-03-27 22:50:29 +0200 | [diff] [blame] | 51 | $(call cmd,syscalls) |
Christoph Lameter | 1cdf25d | 2008-04-28 02:12:44 -0700 | [diff] [blame] | 52 | |
Kieran Bingham | f197d75 | 2016-05-23 16:24:40 -0700 | [diff] [blame] | 53 | ##### |
Linus Torvalds | ffd602e | 2019-03-10 17:48:21 -0700 | [diff] [blame^] | 54 | # Check atomic headers are up-to-date |
Mark Rutland | 8d32588 | 2018-09-04 11:48:29 +0100 | [diff] [blame] | 55 | |
| 56 | always += old-atomics |
| 57 | targets += old-atomics |
| 58 | |
| 59 | quiet_cmd_atomics = CALL $< |
Borislav Petkov | bdf37b4 | 2018-11-08 20:41:28 +0100 | [diff] [blame] | 60 | cmd_atomics = $(CONFIG_SHELL) $< |
Mark Rutland | 8d32588 | 2018-09-04 11:48:29 +0100 | [diff] [blame] | 61 | |
| 62 | old-atomics: scripts/atomic/check-atomics.sh FORCE |
| 63 | $(call cmd,atomics) |
| 64 | |
Nicholas Mc Guire | 0a22798 | 2015-05-18 14:19:12 +0200 | [diff] [blame] | 65 | # Keep these three files during make clean |
| 66 | no-clean-files := $(bounds-file) $(offsets-file) $(timeconst-file) |