]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/blobdiff - scripts/Makefile.lib
Merge tag 'davinci-fixes-for-v4.12' of git://git.kernel.org/pub/scm/linux/kernel...
[mirror_ubuntu-artful-kernel.git] / scripts / Makefile.lib
index c9f975ab98407fdae720340d00e675c2ad8887ca..58c05e5d9870b6c18a72da7dc44ff3112994946d 100644 (file)
@@ -175,7 +175,7 @@ ld_flags       = $(LDFLAGS) $(ldflags-y)
 
 dtc_cpp_flags  = -Wp,-MD,$(depfile).pre.tmp -nostdinc                    \
                 -I$(srctree)/arch/$(SRCARCH)/boot/dts                   \
-                -I$(srctree)/arch/$(SRCARCH)/boot/dts/include           \
+                -I$(srctree)/scripts/dtc/include-prefixes               \
                 -I$(srctree)/drivers/of/testcase-data                   \
                 -undef -D__DTS__
 
@@ -420,3 +420,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