aboutsummaryrefslogblamecommitdiffstatshomepage
path: root/makefile_escaping/escaping_quotes.mk
blob: 2d953f86ef6442d48e0280f47911d7f44a3b3e52 (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11










                                                           
escape = $(subst ','\'',$(1))

test_var := Includes ' quote

echo_test_var := printf '%s\n' '$(call escape,$(test_var))'
bash_test_var := bash -c '$(call escape,$(echo_test_var))'

test:
	printf '%s\n' '$(call escape,$(test_var))'
	bash -c '$(call escape,$(echo_test_var))'
	bash -c '$(call escape,$(bash_test_var))'