Lines Matching refs:shell

22 # GNU make's $(shell ...) function converts to a
42 # shell-escape-nl
44 # Usage: $(shell some-command | $(call shell-escape-nl[,escape]))
46 # Use this to escape newlines from within a shell call;
50 # in an `awk' program that is delimited by shell
54 define shell-escape-nl
58 # shell-unescape-nl
60 # Usage: $(shell some-command | $(call shell-unescape-nl[,escape]))
62 # Use this to unescape newlines from within a shell call;
67 # delimited by shell single-quotes, so be wary
70 # (The bash shell has a bug where `{gsub(...),...}' is
74 define shell-unescape-nl
78 # escape-for-shell-sq
80 # Usage: embeddable-text = $(call escape-for-shell-sq,text)
83 # embedding in a shell string that is delimited by
86 escape-for-shell-sq = $(subst ','\'',$(1))
88 # shell-sq
90 # Usage: single-quoted-and-escaped-text = $(call shell-sq,text)
92 shell-sq = '$(escape-for-shell-sq)'
94 # shell-wordify
96 # Usage: wordified-text = $(call shell-wordify,text)
106 # | echo $(call shell-wordify,$(text))
110 # (this is in constrast to a `$(shell ...)' function call,
114 # that works as a shell word, regardless of whether or
118 # an intrictate shell command substitution is constructed
119 # to render the text as a single line; when the shell
124 # produces the same results as the `$(shell-sq)' function.
126 shell-wordify = $(if $(findstring $(newline),$(1)),$(_sw-esc-nl),$(shell-sq))
128 "$$(echo $(call escape-nl,$(shell-sq),$(2)) | $(call shell-unescape-nl,$(2)))"
135 is-absolute = $(shell echo $(shell-sq) | grep ^/ -q && echo y)
144 lookup = $(call unescape-nl,$(shell sh -c $(_l-sh)))
145 _l-sh = $(call shell-sq,command -v $(shell-sq) | $(call shell-escape-nl,))
154 is-executable = $(call _is-executable-helper,$(shell-sq))
155 _is-executable-helper = $(shell sh -c $(_is-executable-sh))
156 _is-executable-sh = $(call shell-sq,test -f $(1) -a -x $(1) && echo y)
189 try-cc = $(shell sh -c \