$(1)_FILENAME := $$(subst \\,\,$$(subst \$$(quote),$$(quote),$$(subst $$(space_escape),\$$(space),$$(patsubst "%",%,$$(subst $$(space),$$(space_escape),$$(CONFIG_$(1)))))))
# kbuild: Generic definitions
space := $(empty) $(empty)
space_escape := _-_SPACE_-_
# Name of target with a '.' as filename prefix. foo/bar.o => foo/.bar.o
dot-target = $(dir $@).$(notdir $@)
# The temporary file to save gcc -MD generated dependencies must not
depfile = $(subst $(comma),_,$(dot-target).d)
# filename of target with directory and extension stripped
basetarget = $(basename $(notdir $@))
# real prerequisites without phony targets
real-prereqs = $(filter-out $(PHONY), $^)
# Escape single quote for use in echo statements
escsq = $(subst $(squote),'\$(squote)',$1)
# Easy method for doing a status message
kecho := $($(quiet)kecho)
# filechk is used to check if the content of a generated file is updated.
# filechk_sample = echo $(KERNELRELEASE)
# The rule defined shall write to stdout the content of the new file.
# The existing file will be compared with the new one.
# - If no file exist it is created
# - If the content differ the new file is used
# - If they are equal no change, and no timestamp update
# - stdin is piped in from the first prerequisite ($<) so one has
# to specify a valid file as first prerequisite (often the kbuild file)
{ $(filechk_$(1)); } > $@.tmp; \
if [ -r $@ ] && cmp -s $@ $@.tmp; then \