aboutsummaryrefslogblamecommitdiffstatshomepage
path: root/makefile_escaping/shell.mk
blob: 36db8d8bc025e2f125a37d96ff05f869aa13158c (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11
12
13
14













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

cwd := $(shell basename -- "$$( pwd )")
export cwd

echo_cwd := printf '%s\n' '$(call escape,$(cwd))'
bash_cwd := bash -c '$(call escape,$(echo_cwd))'

.PHONY: test
test:
	@printf '%s\n' '$(call escape,$(cwd))'
	@printf '%s\n' "$$cwd"
	@bash -c '$(call escape,$(echo_cwd))'
	@bash -c '$(call escape,$(bash_cwd))'