~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/Kbuild

Version: ~ [ linux-5.0-rc6 ] ~ [ linux-4.20.10 ] ~ [ linux-4.19.23 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.101 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.158 ] ~ [ linux-4.8.17 ] ~ [ linux-4.7.10 ] ~ [ linux-4.6.7 ] ~ [ linux-4.5.7 ] ~ [ linux-4.4.174 ] ~ [ linux-4.3.6 ] ~ [ linux-4.2.8 ] ~ [ linux-4.1.52 ] ~ [ linux-4.0.9 ] ~ [ linux-3.19.8 ] ~ [ linux-3.18.134 ] ~ [ linux-3.17.8 ] ~ [ linux-3.16.63 ] ~ [ linux-3.15.10 ] ~ [ linux-3.14.79 ] ~ [ linux-3.13.11 ] ~ [ linux-3.12.74 ] ~ [ linux-3.11.10 ] ~ [ linux-3.10.108 ] ~ [ linux-3.9.11 ] ~ [ linux-3.8.13 ] ~ [ linux-3.7.10 ] ~ [ linux-3.6.11 ] ~ [ linux-3.5.7 ] ~ [ linux-3.4.113 ] ~ [ linux-3.3.8 ] ~ [ linux-3.2.102 ] ~ [ linux-3.1.10 ] ~ [ linux-3.0.101 ] ~ [ linux-2.6.39.4 ] ~ [ linux-2.6.38.8 ] ~ [ linux-2.6.37.6 ] ~ [ linux-2.6.36.4 ] ~ [ linux-2.6.35.14 ] ~ [ linux-2.6.34.15 ] ~ [ linux-2.6.33.20 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.5 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 # SPDX-License-Identifier: GPL-2.0
  2 #
  3 # Kbuild for top-level directory of the kernel
  4 # This file takes care of the following:
  5 # 1) Generate bounds.h
  6 # 2) Generate timeconst.h
  7 # 3) Generate asm-offsets.h (may need bounds.h and timeconst.h)
  8 # 4) Check for missing system calls
  9 # 5) Generate constants.py (may need bounds.h)
 10 
 11 #####
 12 # 1) Generate bounds.h
 13 
 14 bounds-file := include/generated/bounds.h
 15 
 16 always  := $(bounds-file)
 17 targets := kernel/bounds.s
 18 
 19 $(bounds-file): kernel/bounds.s FORCE
 20         $(call filechk,offsets,__LINUX_BOUNDS_H__)
 21 
 22 #####
 23 # 2) Generate timeconst.h
 24 
 25 timeconst-file := include/generated/timeconst.h
 26 
 27 targets += $(timeconst-file)
 28 
 29 filechk_gentimeconst = echo $(CONFIG_HZ) | bc -q $<
 30 
 31 $(timeconst-file): kernel/time/timeconst.bc FORCE
 32         $(call filechk,gentimeconst)
 33 
 34 #####
 35 # 3) Generate asm-offsets.h
 36 #
 37 
 38 offsets-file := include/generated/asm-offsets.h
 39 
 40 always  += $(offsets-file)
 41 targets += arch/$(SRCARCH)/kernel/asm-offsets.s
 42 
 43 arch/$(SRCARCH)/kernel/asm-offsets.s: $(timeconst-file) $(bounds-file)
 44 
 45 $(offsets-file): arch/$(SRCARCH)/kernel/asm-offsets.s FORCE
 46         $(call filechk,offsets,__ASM_OFFSETS_H__)
 47 
 48 #####
 49 # 4) Check for missing system calls
 50 #
 51 
 52 always += missing-syscalls
 53 targets += missing-syscalls
 54 
 55 quiet_cmd_syscalls = CALL    $<
 56       cmd_syscalls = $(CONFIG_SHELL) $< $(CC) $(c_flags) $(missing_syscalls_flags)
 57 
 58 missing-syscalls: scripts/checksyscalls.sh $(offsets-file) FORCE
 59         $(call cmd,syscalls)
 60 
 61 #####
 62 # 5) Generate constants for Python GDB integration
 63 #
 64 
 65 extra-$(CONFIG_GDB_SCRIPTS) += build_constants_py
 66 
 67 build_constants_py: $(timeconst-file) $(bounds-file)
 68         @$(MAKE) $(build)=scripts/gdb/linux $@
 69 
 70 # Keep these three files during make clean
 71 no-clean-files := $(bounds-file) $(offsets-file) $(timeconst-file)

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | Wiki (Japanese) | Wiki (English) | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

osdn.jp