diff options
Diffstat (limited to 'scripts/Makefile.lib')
| -rw-r--r-- | scripts/Makefile.lib | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib index 0a07f9014944..dd567e5d59e0 100644 --- a/scripts/Makefile.lib +++ b/scripts/Makefile.lib | |||
| @@ -408,3 +408,31 @@ quiet_cmd_xzmisc = XZMISC $@ | |||
| 408 | cmd_xzmisc = (cat $(filter-out FORCE,$^) | \ | 408 | cmd_xzmisc = (cat $(filter-out FORCE,$^) | \ |
| 409 | xz --check=crc32 --lzma2=dict=1MiB) > $@ || \ | 409 | xz --check=crc32 --lzma2=dict=1MiB) > $@ || \ |
| 410 | (rm -f $@ ; false) | 410 | (rm -f $@ ; false) |
| 411 | |||
| 412 | # ASM offsets | ||
| 413 | # --------------------------------------------------------------------------- | ||
| 414 | |||
| 415 | # Default sed regexp - multiline due to syntax constraints | ||
| 416 | define sed-offsets | ||
| 417 | "/^->/{s:->#\(.*\):/* \1 */:; \ | ||
| 418 | s:^->\([^ ]*\) [\$$#]*\([-0-9]*\) \(.*\):#define \1 \2 /* \3 */:; \ | ||
| 419 | s:^->\([^ ]*\) [\$$#]*\([^ ]*\) \(.*\):#define \1 \2 /* \3 */:; \ | ||
| 420 | s:->::; p;}" | ||
| 421 | endef | ||
| 422 | |||
| 423 | # Use filechk to avoid rebuilds when a header changes, but the resulting file | ||
| 424 | # does not | ||
| 425 | define filechk_offsets | ||
| 426 | (set -e; \ | ||
| 427 | echo "#ifndef $2"; \ | ||
| 428 | echo "#define $2"; \ | ||
| 429 | echo "/*"; \ | ||
| 430 | echo " * DO NOT MODIFY."; \ | ||
| 431 | echo " *"; \ | ||
| 432 | echo " * This file was generated by Kbuild"; \ | ||
| 433 | echo " */"; \ | ||
| 434 | echo ""; \ | ||
| 435 | sed -ne $(sed-offsets); \ | ||
| 436 | echo ""; \ | ||
| 437 | echo "#endif" ) | ||
| 438 | endef | ||
