From 889987ba3f86f6989f32d121f8255d15d1e832fc Mon Sep 17 00:00:00 2001 From: Egor Tensin Date: Wed, 31 Mar 2021 20:27:59 +0300 Subject: makefile_escaping: Makefile best practices --- makefile_escaping/escaping_env_vars.mk | 6 +++--- makefile_escaping/escaping_quotes.mk | 2 +- makefile_escaping/escaping_shell.mk | 2 +- 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: -- cgit v1.2.3