xref: /freebsd/contrib/bmake/unit-tests/sh-meta-chars.mk (revision 06b9b3e0ad0dc3f0166b3e8f26ced68c271cf527)
1*06b9b3e0SSimon J. Gerraty# $NetBSD: sh-meta-chars.mk,v 1.4 2020/12/07 22:27:56 rillig Exp $
22c3632d1SSimon J. Gerraty#
32c3632d1SSimon J. Gerraty# Tests for running shell commands that contain meta-characters.
42c3632d1SSimon J. Gerraty#
52c3632d1SSimon J. Gerraty# These meta-characters decide whether the command is run by the shell
6e2eeea75SSimon J. Gerraty# or executed directly via execv, but only in compatibility mode, not
7e2eeea75SSimon J. Gerraty# in jobs mode, and only if MAKE_NATIVE is defined during compilation.
8e2eeea75SSimon J. Gerraty#
9e2eeea75SSimon J. Gerraty# See also:
10e2eeea75SSimon J. Gerraty#	Compat_RunCommand, useShell
112c3632d1SSimon J. Gerraty
122c3632d1SSimon J. Gerratyall:
13*06b9b3e0SSimon J. Gerraty
14*06b9b3e0SSimon J. Gerraty# The command "exit 0" contains no special characters, therefore it is
15*06b9b3e0SSimon J. Gerraty# run directly via execv, but only if MAKE_NATIVE is defined.
16*06b9b3e0SSimon J. GerratyUSING_EXEC!=	{ echo 'all:; exit 0' | ${MAKE} -r -f - 1>/dev/null 2>&1; } \
17*06b9b3e0SSimon J. Gerraty		&& echo yes || echo no
18*06b9b3e0SSimon J. Gerraty
19*06b9b3e0SSimon J. Gerraty# It's hard to do any useful tests that result in the same output.
20*06b9b3e0SSimon J. Gerraty# See SED_CMDS.sh-dots, which normalizes the test output for the specific
21*06b9b3e0SSimon J. Gerraty# case of the special command '...'.
22*06b9b3e0SSimon J. Gerraty.if ${USING_EXEC} != "yes" && ${USING_EXEC} != "no"
23*06b9b3e0SSimon J. Gerraty.  error
24*06b9b3e0SSimon J. Gerraty.endif
25