2 # Kbuild for top-level directory of the kernel
3 # This file takes care of the following:
4 # 1) Generate asm-offsets.h
7 # 1) Generate asm-offsets.h
10 offsets-file := include/asm-$(ARCH)/asm-offsets.h
12 always := $(offsets-file)
13 targets := $(offsets-file)
14 targets += arch/$(ARCH)/kernel/asm-offsets.s
16 quiet_cmd_offsets = GEN $@
20 echo "#ifndef __ASM_OFFSETS_H__"; \
21 echo "#define __ASM_OFFSETS_H__"; \
23 echo " * DO NOT MODIFY."; \
25 echo " * This file was generated by $(srctree)/Kbuild"; \
29 sed -ne "/^->/{s:^->\([^ ]*\) [\$$#]*\([^ ]*\) \(.*\):#define \1 \2 /* \3 */:; s:->::; p;}"; \
34 # We use internal kbuild rules to avoid the "is up to date" message from make
35 arch/$(ARCH)/kernel/asm-offsets.s: arch/$(ARCH)/kernel/asm-offsets.c FORCE
36 $(Q)mkdir -p $(dir $@)
37 $(call if_changed_dep,cc_s_c)
39 $(srctree)/$(offsets-file): arch/$(ARCH)/kernel/asm-offsets.s Kbuild