History

Merge tag 'modsign-pkcs7-20150814' of git://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-fs into ra-next

James Morris committed 11 years ago

Commit f062bca2 parents 3e5f206 3ee550f11 files · +212 −198Browse files

Showing the changes to scripts (1 of 11 files). Show all

Unified · Split

scripts/Kbuild.include+51−0
@@ -303,3 +303,54 @@ why = \ · 302 unmodified lines
303 303
304echo-why = $(call escsq, $(strip $(why)))304echo-why = $(call escsq, $(strip $(why)))
305endif305endif
306
307###############################################################################
308#
309# When a Kconfig string contains a filename, it is suitable for
310# passing to shell commands. It is surrounded by double-quotes, and
311# any double-quotes or backslashes within it are escaped by
312# backslashes.
313#
314# This is no use for dependencies or $(wildcard). We need to strip the
315# surrounding quotes and the escaping from quotes and backslashes, and
316# we *do* need to escape any spaces in the string. So, for example:
317#
318# Usage: $(eval $(call config_filename,FOO))
319#
320# Defines FOO_FILENAME based on the contents of the CONFIG_FOO option,
321# transformed as described above to be suitable for use within the
322# makefile.
323#
324# Also, if the filename is a relative filename and exists in the source
325# tree but not the build tree, define FOO_SRCPREFIX as $(srctree)/ to
326# be prefixed to *both* command invocation and dependencies.
327#
328# Note: We also print the filenames in the quiet_cmd_foo text, and
329# perhaps ought to have a version specially escaped for that purpose.
330# But it's only cosmetic, and $(patsubst "%",%,$(CONFIG_FOO)) is good
331# enough. It'll strip the quotes in the common case where there's no
332# space and it's a simple filename, and it'll retain the quotes when
333# there's a space. There are some esoteric cases in which it'll print
334# the wrong thing, but we don't really care. The actual dependencies
335# and commands *do* get it right, with various combinations of single
336# and double quotes, backslashes and spaces in the filenames.
337#
338###############################################################################
339#
340space_escape := %%%SPACE%%%
341#
342define config_filename
343ifneq ($$(CONFIG_$(1)),"")
344$(1)_FILENAME := $$(subst \\,\,$$(subst \$$(quote),$$(quote),$$(subst $$(space_escape),\$$(space),$$(patsubst "%",%,$$(subst $$(space),$$(space_escape),$$(CONFIG_$(1)))))))
345ifneq ($$(patsubst /%,%,$$(firstword $$($(1)_FILENAME))),$$(firstword $$($(1)_FILENAME)))
346else
347ifeq ($$(wildcard $$($(1)_FILENAME)),)
348ifneq ($$(wildcard $$(srctree)/$$($(1)_FILENAME)),)
349$(1)_SRCPREFIX := $(srctree)/
350endif
351endif
352endif
353endif
354endef
355#
356###############################################################################