aboutsummaryrefslogtreecommitdiffstats
path: root/Kbuild
diff options
context:
space:
mode:
Diffstat (limited to 'Kbuild')
-rw-r--r--Kbuild9
1 files changed, 8 insertions, 1 deletions
diff --git a/Kbuild b/Kbuild
index 197ece85034b..1880e6f760aa 100644
--- a/Kbuild
+++ b/Kbuild
@@ -13,6 +13,13 @@ always := $(offsets-file)
13targets := $(offsets-file) 13targets := $(offsets-file)
14targets += arch/$(ARCH)/kernel/asm-offsets.s 14targets += arch/$(ARCH)/kernel/asm-offsets.s
15 15
16# Default sed regexp - multiline due to syntax constraints
17define sed-y
18 "/^->/{s:^->\([^ ]*\) [\$$#]*\([^ ]*\) \(.*\):#define \1 \2 /* \3 */:; s:->::; p;}"
19endef
20# Override default regexp for specific architectures
21sed-$(CONFIG_MIPS) := "/^@@@/s///p"
22
16quiet_cmd_offsets = GEN $@ 23quiet_cmd_offsets = GEN $@
17define cmd_offsets 24define cmd_offsets
18 cat $< | \ 25 cat $< | \
@@ -26,7 +33,7 @@ define cmd_offsets
26 echo " *"; \ 33 echo " *"; \
27 echo " */"; \ 34 echo " */"; \
28 echo ""; \ 35 echo ""; \
29 sed -ne "/^->/{s:^->\([^ ]*\) [\$$#]*\([^ ]*\) \(.*\):#define \1 \2 /* \3 */:; s:->::; p;}"; \ 36 sed -ne $(sed-y); \
30 echo ""; \ 37 echo ""; \
31 echo "#endif" ) > $@ 38 echo "#endif" ) > $@
32endef 39endef