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>
Šī revīzija ir iekļauta:

revīziju iesūtīja
Masahiro Yamada

vecāks
6748cb3c29
revīzija
ebf003f0cf
@@ -7,32 +7,8 @@ modpost-objs := modpost.o file2alias.o sumversion.o
|
||||
|
||||
devicetable-offsets-file := devicetable-offsets.h
|
||||
|
||||
define sed-y
|
||||
"/^->/{s:->#\(.*\):/* \1 */:; \
|
||||
s:^->\([^ ]*\) [\$$#]*\([-0-9]*\) \(.*\):#define \1 \2 /* \3 */:; \
|
||||
s:^->\([^ ]*\) [\$$#]*\([^ ]*\) \(.*\):#define \1 \2 /* \3 */:; \
|
||||
s:->::; p;}"
|
||||
endef
|
||||
|
||||
quiet_cmd_offsets = GEN $@
|
||||
define cmd_offsets
|
||||
(set -e; \
|
||||
echo "#ifndef __DEVICETABLE_OFFSETS_H__"; \
|
||||
echo "#define __DEVICETABLE_OFFSETS_H__"; \
|
||||
echo "/*"; \
|
||||
echo " * DO NOT MODIFY."; \
|
||||
echo " *"; \
|
||||
echo " * This file was generated by Kbuild"; \
|
||||
echo " *"; \
|
||||
echo " */"; \
|
||||
echo ""; \
|
||||
sed -ne $(sed-y) $<; \
|
||||
echo ""; \
|
||||
echo "#endif" ) > $@
|
||||
endef
|
||||
|
||||
$(obj)/$(devicetable-offsets-file): $(obj)/devicetable-offsets.s
|
||||
$(call if_changed,offsets)
|
||||
$(obj)/$(devicetable-offsets-file): $(obj)/devicetable-offsets.s FORCE
|
||||
$(call filechk,offsets,__DEVICETABLE_OFFSETS_H__)
|
||||
|
||||
targets += $(devicetable-offsets-file) devicetable-offsets.s
|
||||
|
||||
|
Atsaukties uz šo jaunā problēmā
Block a user