2017-11-01 15:07:57 +01:00
|
|
|
# SPDX-License-Identifier: GPL-2.0
|
2005-09-09 19:28:28 +02:00
|
|
|
#
|
|
|
|
|
# Kbuild for top-level directory of the kernel
|
|
|
|
|
|
2015-01-05 15:57:15 +09:00
|
|
|
#####
|
2019-02-19 18:33:03 +09:00
|
|
|
# Generate bounds.h
|
2015-01-05 15:57:15 +09:00
|
|
|
|
|
|
|
|
bounds-file := include/generated/bounds.h
|
|
|
|
|
|
2020-02-02 01:49:24 +09:00
|
|
|
always-y := $(bounds-file)
|
2015-03-26 20:59:52 +09:00
|
|
|
targets := kernel/bounds.s
|
2015-01-05 15:57:15 +09:00
|
|
|
|
2018-12-22 18:50:35 +09:00
|
|
|
$(bounds-file): kernel/bounds.s FORCE
|
2015-03-11 11:01:01 +01:00
|
|
|
$(call filechk,offsets,__LINUX_BOUNDS_H__)
|
2015-01-05 15:57:15 +09:00
|
|
|
|
|
|
|
|
#####
|
2019-02-19 18:33:03 +09:00
|
|
|
# Generate timeconst.h
|
2015-05-18 14:19:12 +02:00
|
|
|
|
|
|
|
|
timeconst-file := include/generated/timeconst.h
|
|
|
|
|
|
2019-01-03 10:16:54 +09:00
|
|
|
filechk_gentimeconst = echo $(CONFIG_HZ) | bc -q $<
|
2015-05-18 14:19:12 +02:00
|
|
|
|
2018-12-22 18:50:35 +09:00
|
|
|
$(timeconst-file): kernel/time/timeconst.bc FORCE
|
2015-05-18 14:19:12 +02:00
|
|
|
$(call filechk,gentimeconst)
|
|
|
|
|
|
|
|
|
|
#####
|
2019-02-19 18:33:03 +09:00
|
|
|
# Generate asm-offsets.h
|
2015-01-05 15:57:15 +09:00
|
|
|
|
|
|
|
|
offsets-file := include/generated/asm-offsets.h
|
|
|
|
|
|
2020-02-02 01:49:24 +09:00
|
|
|
always-y += $(offsets-file)
|
2015-01-05 15:57:15 +09:00
|
|
|
targets += arch/$(SRCARCH)/kernel/asm-offsets.s
|
|
|
|
|
|
2018-12-22 18:50:35 +09:00
|
|
|
arch/$(SRCARCH)/kernel/asm-offsets.s: $(timeconst-file) $(bounds-file)
|
2005-09-09 19:28:28 +02:00
|
|
|
|
2018-12-22 18:50:35 +09:00
|
|
|
$(offsets-file): arch/$(SRCARCH)/kernel/asm-offsets.s FORCE
|
2015-03-11 11:01:01 +01:00
|
|
|
$(call filechk,offsets,__ASM_OFFSETS_H__)
|
2005-09-09 19:28:28 +02:00
|
|
|
|
2007-03-27 22:50:29 +02:00
|
|
|
#####
|
2019-02-19 18:33:03 +09:00
|
|
|
# Check for missing system calls
|
2007-03-27 22:50:29 +02:00
|
|
|
|
2020-02-02 01:49:24 +09:00
|
|
|
always-y += missing-syscalls
|
2011-08-24 21:03:30 -04:00
|
|
|
|
2007-03-27 22:50:29 +02:00
|
|
|
quiet_cmd_syscalls = CALL $<
|
2011-11-08 10:20:10 -08:00
|
|
|
cmd_syscalls = $(CONFIG_SHELL) $< $(CC) $(c_flags) $(missing_syscalls_flags)
|
2007-03-27 22:50:29 +02:00
|
|
|
|
2011-08-24 21:03:30 -04:00
|
|
|
missing-syscalls: scripts/checksyscalls.sh $(offsets-file) FORCE
|
2007-03-27 22:50:29 +02:00
|
|
|
$(call cmd,syscalls)
|
2008-04-28 02:12:44 -07:00
|
|
|
|
2016-05-23 16:24:40 -07:00
|
|
|
#####
|
2019-03-10 17:48:21 -07:00
|
|
|
# Check atomic headers are up-to-date
|
2018-09-04 11:48:29 +01:00
|
|
|
|
2020-02-02 01:49:24 +09:00
|
|
|
always-y += old-atomics
|
2018-09-04 11:48:29 +01:00
|
|
|
|
|
|
|
|
quiet_cmd_atomics = CALL $<
|
2018-11-08 20:41:28 +01:00
|
|
|
cmd_atomics = $(CONFIG_SHELL) $<
|
2018-09-04 11:48:29 +01:00
|
|
|
|
|
|
|
|
old-atomics: scripts/atomic/check-atomics.sh FORCE
|
|
|
|
|
$(call cmd,atomics)
|