2 # Kbuild for top-level directory of the kernel
3 # This file takes care of the following:
5 # 2) Generate asm-offsets.h (may need bounds.h)
6 # 3) Check for missing system calls
8 # Default sed regexp - multiline due to syntax constraints
10 "/^->/{s:->#\(.*\):/* \1 */:; \
11 s:^->\([^ ]*\) [\$$#]*\([-0-9]*\) \(.*\):#define \1 \2 /* \3 */:; \
12 s:^->\([^ ]*\) [\$$#]*\([^ ]*\) \(.*\):#define \1 \2 /* \3 */:; \
16 quiet_cmd_offsets = GEN $@
22 echo " * DO NOT MODIFY."; \
24 echo " * This file was generated by Kbuild"; \
28 sed -ne $(sed-y) $<; \
34 # 1) Generate bounds.h
36 bounds-file := include/generated/bounds.h
38 always := $(bounds-file)
39 targets := $(bounds-file) kernel/bounds.s
41 # We use internal kbuild rules to avoid the "is up to date" message from make
42 kernel/bounds.s: kernel/bounds.c FORCE
43 $(Q)mkdir -p $(dir $@)
44 $(call if_changed_dep,cc_s_c)
46 $(obj)/$(bounds-file): kernel/bounds.s Kbuild
47 $(Q)mkdir -p $(dir $@)
48 $(call cmd,offsets,__LINUX_BOUNDS_H__)
51 # 2) Generate asm-offsets.h
54 offsets-file := include/generated/asm-offsets.h
56 always += $(offsets-file)
57 targets += $(offsets-file)
58 targets += arch/$(SRCARCH)/kernel/asm-offsets.s
60 # We use internal kbuild rules to avoid the "is up to date" message from make
61 arch/$(SRCARCH)/kernel/asm-offsets.s: arch/$(SRCARCH)/kernel/asm-offsets.c \
62 $(obj)/$(bounds-file) FORCE
63 $(Q)mkdir -p $(dir $@)
64 $(call if_changed_dep,cc_s_c)
66 $(obj)/$(offsets-file): arch/$(SRCARCH)/kernel/asm-offsets.s Kbuild
67 $(call cmd,offsets,__ASM_OFFSETS_H__)
70 # 3) Check for missing system calls
73 always += missing-syscalls
74 targets += missing-syscalls
76 quiet_cmd_syscalls = CALL $<
77 cmd_syscalls = $(CONFIG_SHELL) $< $(CC) $(c_flags) $(missing_syscalls_flags)
79 missing-syscalls: scripts/checksyscalls.sh $(offsets-file) FORCE
82 # Keep these two files during make clean
83 no-clean-files := $(bounds-file) $(offsets-file)