]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/blobdiff - scripts/Kbuild.include
kbuild: shrink .cache.mk when it exceeds 1000 lines
[mirror_ubuntu-bionic-kernel.git] / scripts / Kbuild.include
index dfadb1c94368fbf6d2127685dcddfe6ebe1a3692..064f477dfdca02e7fd2bb26d8924c664c15c1032 100644 (file)
@@ -105,6 +105,12 @@ endif
 $(make-cache): ;
 -include $(make-cache)
 
+# If cache exceeds 1000 lines, shrink it down to 500.
+ifneq ($(word 1000,$(filter __cached_%, $(.VARIABLES))),)
+$(shell tail -n 500 $(make-cache) > $(make-cache).tmp; \
+       mv $(make-cache).tmp $(make-cache))
+endif
+
 # Usage: $(call __sanitize-opt,Hello=Hola$(comma)Goodbye Adios)
 #
 # Convert all '$', ')', '(', '\', '=', ' ', ',', ':' to '_'