aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/makefile_escaping
diff options
context:
space:
mode:
Diffstat (limited to 'makefile_escaping')
-rw-r--r--makefile_escaping/escaping_env_vars.mk34
-rw-r--r--makefile_escaping/escaping_quotes.mk19
-rw-r--r--makefile_escaping/escaping_shell.mk19
-rw-r--r--makefile_escaping/quoting_args.mk16
4 files changed, 0 insertions, 88 deletions
diff --git a/makefile_escaping/escaping_env_vars.mk b/makefile_escaping/escaping_env_vars.mk
deleted file mode 100644
index 28fc9c6..0000000
--- a/makefile_escaping/escaping_env_vars.mk
+++ /dev/null
@@ -1,34 +0,0 @@
-MAKEFLAGS += --no-builtin-rules --no-builtin-variables --warn-undefined-variables
-unexport MAKEFLAGS
-.DEFAULT_GOAL := all
-.DELETE_ON_ERROR:
-.SUFFIXES:
-SHELL := bash
-.SHELLFLAGS := -eu -o pipefail -c
-
-escape = $(subst ','\'',$(1))
-
-define noexpand
-ifeq ($$(origin $(1)),environment)
- $(1) := $$(value $(1))
-endif
-ifeq ($$(origin $(1)),environment override)
- $(1) := $$(value $(1))
-endif
-ifeq ($$(origin $(1)),command line)
- override $(1) := $$(value $(1))
-endif
-endef
-
-simple_var := Simple value
-
-test_var ?= $(simple_var) in test_var
-$(eval $(call noexpand,test_var))
-
-simple_var := New simple value
-composite_var := Composite value - $(simple_var) - $(test_var)
-
-.PHONY: test
-test:
- @printf '%s\n' '$(call escape,$(test_var))'
- @printf '%s\n' '$(call escape,$(composite_var))'
diff --git a/makefile_escaping/escaping_quotes.mk b/makefile_escaping/escaping_quotes.mk
deleted file mode 100644
index f6d7994..0000000
--- a/makefile_escaping/escaping_quotes.mk
+++ /dev/null
@@ -1,19 +0,0 @@
-MAKEFLAGS += --no-builtin-rules --no-builtin-variables --warn-undefined-variables
-unexport MAKEFLAGS
-.DEFAULT_GOAL := all
-.DELETE_ON_ERROR:
-.SUFFIXES:
-SHELL := bash
-.SHELLFLAGS := -eu -o pipefail -c
-
-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))'
diff --git a/makefile_escaping/escaping_shell.mk b/makefile_escaping/escaping_shell.mk
deleted file mode 100644
index 365e6ff..0000000
--- a/makefile_escaping/escaping_shell.mk
+++ /dev/null
@@ -1,19 +0,0 @@
-MAKEFLAGS += --no-builtin-rules --no-builtin-variables --warn-undefined-variables
-unexport MAKEFLAGS
-.DEFAULT_GOAL := all
-.DELETE_ON_ERROR:
-.SUFFIXES:
-SHELL := bash
-.SHELLFLAGS := -eu -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))'
diff --git a/makefile_escaping/quoting_args.mk b/makefile_escaping/quoting_args.mk
deleted file mode 100644
index 6d7278c..0000000
--- a/makefile_escaping/quoting_args.mk
+++ /dev/null
@@ -1,16 +0,0 @@
-MAKEFLAGS += --no-builtin-rules --no-builtin-variables --warn-undefined-variables
-unexport MAKEFLAGS
-.DEFAULT_GOAL := all
-.DELETE_ON_ERROR:
-.SUFFIXES:
-SHELL := bash
-.SHELLFLAGS := -eu -o pipefail -c
-
-test_var := Same line?
-export test_var
-
-test:
- @printf '%s\n' $(test_var)
- @printf '%s\n' '$(test_var)'
- @printf '%s\n' $$test_var
- @printf '%s\n' "$$test_var"