Hi,
Maybe this has been done before, but I couldn't find it on the nets.
The
example Makefile below illustrates how to quote an arbitrary value as a
word in
a shell script. One use case for this is to evaluate a value as a
complete
shell script, similar to .ONESHELL but allowing all shell fe
Given the following Makefile,
define newline
endef
define cmd1
thing1
thing2
endef
help:
echo '$(subst $(newline),'$$'\n'',$(cmd1))'
.PHONY: help
, on an Ubuntu 22.04 system, GNU Make 4.3, Bash 5.1.16(1), and the
Makefile below, "make help" produces the following