diff options
author | Egor Tensin <Egor.Tensin@gmail.com> | 2021-03-31 20:27:59 +0300 |
---|---|---|
committer | Egor Tensin <Egor.Tensin@gmail.com> | 2021-03-31 20:27:59 +0300 |
commit | 889987ba3f86f6989f32d121f8255d15d1e832fc (patch) | |
tree | 066724b0f28ac90fa7a42b91e1cf4aac8a58c25f /makefile_escaping | |
parent | makefile_escaping: a bit prettier YAML (diff) | |
download | blog-889987ba3f86f6989f32d121f8255d15d1e832fc.tar.gz blog-889987ba3f86f6989f32d121f8255d15d1e832fc.zip |
makefile_escaping: Makefile best practices
Diffstat (limited to 'makefile_escaping')
-rw-r--r-- | makefile_escaping/escaping_env_vars.mk | 6 | ||||
-rw-r--r-- | makefile_escaping/escaping_quotes.mk | 2 | ||||
-rw-r--r-- | makefile_escaping/escaping_shell.mk | 2 | ||||
-rw-r--r-- | makefile_escaping/quoting_args.mk | 2 |
4 files changed, 6 insertions, 6 deletions
diff --git a/makefile_escaping/escaping_env_vars.mk b/makefile_escaping/escaping_env_vars.mk index 5ec61ee..e1aeebf 100644 --- a/makefile_escaping/escaping_env_vars.mk +++ b/makefile_escaping/escaping_env_vars.mk @@ -1,4 +1,4 @@ -MAKEFLAGS += --warn-undefined-variables +MAKEFLAGS += --no-builtin-rules --no-builtin-variables --warn-undefined-variables .DEFAULT_GOAL := all .DELETE_ON_ERROR: .SUFFIXES: @@ -7,7 +7,7 @@ SHELL := bash escape = $(subst ','\'',$(1)) -define escape_arg +define noexpand ifeq ($$(origin $(1)),environment) $(1) := $$(value $(1)) endif @@ -22,7 +22,7 @@ endef simple_var := Simple value test_var ?= $(simple_var) in test_var -$(eval $(call escape_arg,test_var)) +$(eval $(call noexpand,test_var)) simple_var := New simple value composite_var := Composite value - $(simple_var) - $(test_var) diff --git a/makefile_escaping/escaping_quotes.mk b/makefile_escaping/escaping_quotes.mk index 2a43f69..4da5ce9 100644 --- a/makefile_escaping/escaping_quotes.mk +++ b/makefile_escaping/escaping_quotes.mk @@ -1,4 +1,4 @@ -MAKEFLAGS += --warn-undefined-variables +MAKEFLAGS += --no-builtin-rules --no-builtin-variables --warn-undefined-variables .DEFAULT_GOAL := all .DELETE_ON_ERROR: .SUFFIXES: diff --git a/makefile_escaping/escaping_shell.mk b/makefile_escaping/escaping_shell.mk index bc6afa2..a7631fb 100644 --- a/makefile_escaping/escaping_shell.mk +++ b/makefile_escaping/escaping_shell.mk @@ -1,4 +1,4 @@ -MAKEFLAGS += --warn-undefined-variables +MAKEFLAGS += --no-builtin-rules --no-builtin-variables --warn-undefined-variables .DEFAULT_GOAL := all .DELETE_ON_ERROR: .SUFFIXES: diff --git a/makefile_escaping/quoting_args.mk b/makefile_escaping/quoting_args.mk index db4f7cf..4bec8ee 100644 --- a/makefile_escaping/quoting_args.mk +++ b/makefile_escaping/quoting_args.mk @@ -1,4 +1,4 @@ -MAKEFLAGS += --warn-undefined-variables +MAKEFLAGS += --no-builtin-rules --no-builtin-variables --warn-undefined-variables .DEFAULT_GOAL := all .DELETE_ON_ERROR: .SUFFIXES: |