GNU make(1) 4.2 seems to be interpreting those characters as the start
of a comment, so we need to escape them. That seems to calm those old
versions of make(1), and doesn't affect negatively the newer ones, and
doesn't affect negatively grep(1) either.
Fixes: 35a780a99bd8 (2024-07-20; "share/mk/: CPPFLAGS: Only define _FORTIFY_SOURCE if it's not already defined")
Fixes: 2130162900ab (2024-11-03; "share/mk/, etc/shellcheck/: lint-sh: Add target to lint shell scripts")
Reported-by: Boris Pigin <boris.pigin@gmail.com>
Cc: Sam James <sam@gentoo.org>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
CPP_HAS_ALREADY_D_FORTIFY_SOURCE := \
$(shell \
$(CPP) -dM - -Wno-error </dev/null \
- | $(GREP) '#define _FORTIFY_SOURCE ' >/dev/null \
+ | $(GREP) '\#define _FORTIFY_SOURCE ' >/dev/null \
&& $(ECHO) yes \
|| $(ECHO) no; \
)
BIN_sh := $(shell $(FIND) $(SRCBINDIR) -type f \
- | $(XARGS) $(GREP) -l '^#!/bin/\(sh\|bash\)\>' \
+ | $(XARGS) $(GREP) -l '^\#!/bin/\(sh\|bash\)\>' \
| $(SORT))