diff options
| author | Matthias Kaehlcke <mka@chromium.org> | 2017-04-12 15:43:52 -0400 |
|---|---|---|
| committer | Masahiro Yamada <yamada.masahiro@socionext.com> | 2017-04-12 16:43:37 -0400 |
| commit | ebf003f0cfb3705e60d40dedc3ec949176c741af (patch) | |
| tree | 38e55cfbac691e87fe377f11dac3b4d1fa285416 /scripts/mod | |
| parent | 6748cb3c299de1ffbe56733647b01dbcc398c419 (diff) | |
kbuild: Consolidate header generation from ASM offset information
Largely redundant code is used in different places to generate C headers
from offset information extracted from assembly language output.
Consolidate the code in Makefile.lib and use this instead.
Signed-off-by: Matthias Kaehlcke <mka@chromium.org>
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Diffstat (limited to 'scripts/mod')
| -rw-r--r-- | scripts/mod/Makefile | 28 |
1 files changed, 2 insertions, 26 deletions
diff --git a/scripts/mod/Makefile b/scripts/mod/Makefile index 19d9bcadc0cc..b497d9764dcf 100644 --- a/scripts/mod/Makefile +++ b/scripts/mod/Makefile | |||
| @@ -7,32 +7,8 @@ modpost-objs := modpost.o file2alias.o sumversion.o | |||
| 7 | 7 | ||
| 8 | devicetable-offsets-file := devicetable-offsets.h | 8 | devicetable-offsets-file := devicetable-offsets.h |
| 9 | 9 | ||
| 10 | define sed-y | 10 | $(obj)/$(devicetable-offsets-file): $(obj)/devicetable-offsets.s FORCE |
| 11 | "/^->/{s:->#\(.*\):/* \1 */:; \ | 11 | $(call filechk,offsets,__DEVICETABLE_OFFSETS_H__) |
| 12 | s:^->\([^ ]*\) [\$$#]*\([-0-9]*\) \(.*\):#define \1 \2 /* \3 */:; \ | ||
| 13 | s:^->\([^ ]*\) [\$$#]*\([^ ]*\) \(.*\):#define \1 \2 /* \3 */:; \ | ||
| 14 | s:->::; p;}" | ||
| 15 | endef | ||
| 16 | |||
| 17 | quiet_cmd_offsets = GEN $@ | ||
| 18 | define cmd_offsets | ||
| 19 | (set -e; \ | ||
| 20 | echo "#ifndef __DEVICETABLE_OFFSETS_H__"; \ | ||
| 21 | echo "#define __DEVICETABLE_OFFSETS_H__"; \ | ||
| 22 | echo "/*"; \ | ||
| 23 | echo " * DO NOT MODIFY."; \ | ||
| 24 | echo " *"; \ | ||
| 25 | echo " * This file was generated by Kbuild"; \ | ||
| 26 | echo " *"; \ | ||
| 27 | echo " */"; \ | ||
| 28 | echo ""; \ | ||
| 29 | sed -ne $(sed-y) $<; \ | ||
| 30 | echo ""; \ | ||
| 31 | echo "#endif" ) > $@ | ||
| 32 | endef | ||
| 33 | |||
| 34 | $(obj)/$(devicetable-offsets-file): $(obj)/devicetable-offsets.s | ||
| 35 | $(call if_changed,offsets) | ||
| 36 | 12 | ||
| 37 | targets += $(devicetable-offsets-file) devicetable-offsets.s | 13 | targets += $(devicetable-offsets-file) devicetable-offsets.s |
| 38 | 14 | ||
