mirror of https://github.com/OpenIPC/firmware.git
52 lines
1.6 KiB
Diff
52 lines
1.6 KiB
Diff
diff -drupN a/scripts/Makefile.lib b/scripts/Makefile.lib
|
|
--- a/scripts/Makefile.lib 2018-08-06 17:23:04.000000000 +0300
|
|
+++ b/scripts/Makefile.lib 2022-06-12 05:28:14.000000000 +0300
|
|
@@ -314,6 +314,12 @@ $(obj)/%.dtb: $(src)/%.dts FORCE
|
|
|
|
dtc-tmp = $(subst $(comma),_,$(dot-target).dts.tmp)
|
|
|
|
+# cat
|
|
+# ---------------------------------------------------------------------------
|
|
+# Concatentate multiple files together
|
|
+quiet_cmd_cat = CAT $@
|
|
+cmd_cat = (cat $(filter-out FORCE,$^) > $@) || (rm -f $@; false)
|
|
+
|
|
# Bzip2
|
|
# ---------------------------------------------------------------------------
|
|
|
|
@@ -408,3 +414,34 @@ quiet_cmd_xzmisc = XZMISC $@
|
|
cmd_xzmisc = (cat $(filter-out FORCE,$^) | \
|
|
xz --check=crc32 --lzma2=dict=1MiB) > $@ || \
|
|
(rm -f $@ ; false)
|
|
+
|
|
+# ASM offsets
|
|
+# ---------------------------------------------------------------------------
|
|
+
|
|
+# Default sed regexp - multiline due to syntax constraints
|
|
+#
|
|
+# Use [:space:] because LLVM's integrated assembler inserts <tab> around
|
|
+# the .ascii directive whereas GCC keeps the <space> as-is.
|
|
+define sed-offsets
|
|
+ 's:^[[:space:]]*\.ascii[[:space:]]*"\(.*\)".*:\1:; \
|
|
+ /^->/{s:->#\(.*\):/* \1 */:; \
|
|
+ s:^->\([^ ]*\) [\$$#]*\([^ ]*\) \(.*\):#define \1 \2 /* \3 */:; \
|
|
+ s:->::; p;}'
|
|
+endef
|
|
+
|
|
+# Use filechk to avoid rebuilds when a header changes, but the resulting file
|
|
+# does not
|
|
+define filechk_offsets
|
|
+ (set -e; \
|
|
+ echo "#ifndef $2"; \
|
|
+ echo "#define $2"; \
|
|
+ echo "/*"; \
|
|
+ echo " * DO NOT MODIFY."; \
|
|
+ echo " *"; \
|
|
+ echo " * This file was generated by Kbuild"; \
|
|
+ echo " */"; \
|
|
+ echo ""; \
|
|
+ sed -ne $(sed-offsets); \
|
|
+ echo ""; \
|
|
+ echo "#endif" )
|
|
+endef
|