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






                                       


                                       
 
                          
                                                         
 


                                              
                                                        
MAKEFLAGS += --warn-undefined-variables
.DEFAULT_GOAL := all
.DELETE_ON_ERROR:
.SUFFIXES:
SHELL := bash
.SHELLFLAGS := -e -o pipefail -c

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

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

simple_var := Simple value
composite_var := Composite value - $(simple_var) - $(cwd)

.PHONY: test
test:
	@printf '%s\n' '$(call escape,$(cwd))'
	@printf '%s\n' '$(call escape,$(composite_var))'