2 # Kbuild for top-level directory of the kernel
3 # This file takes care of the following:
4 # 1) Generate asm-offsets.h
5 # 2) Check for missing system calls
8 # 1) Generate asm-offsets.h
11 offsets-file := include/asm-$(ARCH)/asm-offsets.h
13 always := $(offsets-file)
14 targets := $(offsets-file)
15 targets += arch/$(ARCH)/kernel/asm-offsets.s
16 clean-files := $(addprefix $(objtree)/,$(targets))
18 # Default sed regexp - multiline due to syntax constraints
20 "/^->/{s:^->\([^ ]*\) [\$$#]*\([^ ]*\) \(.*\):#define \1 \2 /* \3 */:; s:->::; p;}"
22 # Override default regexp for specific architectures
23 sed-$(CONFIG_MIPS) := "/^@@@/{s/^@@@//; s/ \#.*\$$//; p;}"
25 quiet_cmd_offsets = GEN $@
28 echo "#ifndef __ASM_OFFSETS_H__"; \
29 echo "#define __ASM_OFFSETS_H__"; \
31 echo " * DO NOT MODIFY."; \
33 echo " * This file was generated by Kbuild"; \
37 sed -ne $(sed-y) $<; \
42 # We use internal kbuild rules to avoid the "is up to date" message from make
43 arch/$(ARCH)/kernel/asm-offsets.s: arch/$(ARCH)/kernel/asm-offsets.c FORCE
44 $(Q)mkdir -p $(dir $@)
45 $(call if_changed_dep,cc_s_c)
47 $(obj)/$(offsets-file): arch/$(ARCH)/kernel/asm-offsets.s Kbuild
48 $(Q)mkdir -p $(dir $@)
52 # 2) Check for missing system calls
55 quiet_cmd_syscalls = CALL $<
56 cmd_syscalls = $(CONFIG_SHELL) $< $(CC) $(c_flags)
58 PHONY += missing-syscalls
59 missing-syscalls: scripts/checksyscalls.sh FORCE