diff options
author | Linus Torvalds <torvalds@g5.osdl.org> | 2005-09-09 18:46:49 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2005-09-09 18:46:49 -0400 |
commit | 486a153f0e294f7cc735838edcb6b32e623cbe52 (patch) | |
tree | f16a31eb3526968dd08aa93c12cbb211f31f2084 /Kbuild | |
parent | 9c8550ee25e26d14a8f0fe1b761a676e23fe3cf0 (diff) | |
parent | f64a227b6b5cc1f8cc7f6ef9cc3351343636bac9 (diff) |
Merge master.kernel.org:/pub/scm/linux/kernel/git/sam/kbuild
Diffstat (limited to 'Kbuild')
-rw-r--r-- | Kbuild | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/Kbuild b/Kbuild new file mode 100644 index 000000000000..1880e6f760aa --- /dev/null +++ b/Kbuild | |||
@@ -0,0 +1,48 @@ | |||
1 | # | ||
2 | # Kbuild for top-level directory of the kernel | ||
3 | # This file takes care of the following: | ||
4 | # 1) Generate asm-offsets.h | ||
5 | |||
6 | ##### | ||
7 | # 1) Generate asm-offsets.h | ||
8 | # | ||
9 | |||
10 | offsets-file := include/asm-$(ARCH)/asm-offsets.h | ||
11 | |||
12 | always := $(offsets-file) | ||
13 | targets := $(offsets-file) | ||
14 | targets += arch/$(ARCH)/kernel/asm-offsets.s | ||
15 | |||
16 | # Default sed regexp - multiline due to syntax constraints | ||
17 | define sed-y | ||
18 | "/^->/{s:^->\([^ ]*\) [\$$#]*\([^ ]*\) \(.*\):#define \1 \2 /* \3 */:; s:->::; p;}" | ||
19 | endef | ||
20 | # Override default regexp for specific architectures | ||
21 | sed-$(CONFIG_MIPS) := "/^@@@/s///p" | ||
22 | |||
23 | quiet_cmd_offsets = GEN $@ | ||
24 | define cmd_offsets | ||
25 | cat $< | \ | ||
26 | (set -e; \ | ||
27 | echo "#ifndef __ASM_OFFSETS_H__"; \ | ||
28 | echo "#define __ASM_OFFSETS_H__"; \ | ||
29 | echo "/*"; \ | ||
30 | echo " * DO NOT MODIFY."; \ | ||
31 | echo " *"; \ | ||
32 | echo " * This file was generated by $(srctree)/Kbuild"; \ | ||
33 | echo " *"; \ | ||
34 | echo " */"; \ | ||
35 | echo ""; \ | ||
36 | sed -ne $(sed-y); \ | ||
37 | echo ""; \ | ||
38 | echo "#endif" ) > $@ | ||
39 | endef | ||
40 | |||
41 | # We use internal kbuild rules to avoid the "is up to date" message from make | ||
42 | arch/$(ARCH)/kernel/asm-offsets.s: arch/$(ARCH)/kernel/asm-offsets.c FORCE | ||
43 | $(Q)mkdir -p $(dir $@) | ||
44 | $(call if_changed_dep,cc_s_c) | ||
45 | |||
46 | $(srctree)/$(offsets-file): arch/$(ARCH)/kernel/asm-offsets.s Kbuild | ||
47 | $(call cmd,offsets) | ||
48 | |||