Merge tag 'armsoc-late' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc
[linux-2.6-block.git] / scripts / Kbuild.include
index bc5f25763c1b9c8ee0b880ff02f753794040510a..6cabf20ce66a3bc687755b2df190c5f68032345a 100644 (file)
@@ -32,6 +32,10 @@ real-prereqs = $(filter-out $(PHONY), $^)
 # Escape single quote for use in echo statements
 escsq = $(subst $(squote),'\$(squote)',$1)
 
+###
+# Quote a string to pass it to C files. foo => '"foo"'
+stringify = $(squote)$(quote)$1$(quote)$(squote)
+
 ###
 # Easy method for doing a status message
        kecho := :
@@ -55,14 +59,13 @@ kecho := $($(quiet)kecho)
 # - stdin is piped in from the first prerequisite ($<) so one has
 #   to specify a valid file as first prerequisite (often the kbuild file)
 define filechk
-       $(Q)set -e;                             \
-       mkdir -p $(dir $@);                     \
-       { $(filechk_$(1)); } > $@.tmp;          \
-       if [ -r $@ ] && cmp -s $@ $@.tmp; then  \
-               rm -f $@.tmp;                   \
-       else                                    \
-               $(kecho) '  UPD     $@';        \
-               mv -f $@.tmp $@;                \
+       $(Q)set -e;                                             \
+       mkdir -p $(dir $@);                                     \
+       trap "rm -f $(dot-target).tmp" EXIT;                    \
+       { $(filechk_$(1)); } > $(dot-target).tmp;               \
+       if [ ! -r $@ ] || ! cmp -s $@ $(dot-target).tmp; then   \
+               $(kecho) '  UPD     $@';                        \
+               mv -f $(dot-target).tmp $@;                     \
        fi
 endef
 
@@ -159,12 +162,6 @@ ld-ifversion = $(shell [ $(ld-version) $(1) $(2) ] && echo $(3) || echo $(4))
 # $(Q)$(MAKE) $(build)=dir
 build := -f $(srctree)/scripts/Makefile.build obj
 
-###
-# Shorthand for $(Q)$(MAKE) -f scripts/Makefile.modbuiltin obj=
-# Usage:
-# $(Q)$(MAKE) $(modbuiltin)=dir
-modbuiltin := -f $(srctree)/scripts/Makefile.modbuiltin obj
-
 ###
 # Shorthand for $(Q)$(MAKE) -f scripts/Makefile.dtbinst obj=
 # Usage: