freebsd-dev/contrib/bmake/unit-tests/sh-meta-chars.mk
Simon J. Gerraty 06b9b3e0ad Merge bmake-20210110
Quite a lot of churn on style, but lots of
good work refactoring complicated functions
and lots more unit-tests.
Thanks mostly to rillig at NetBSD

Some interesting entries from ChangeLog

o .MAKE.{UID,GID} represent uid and gid running make.

o allow env var MAKE_OBJDIR_CHECK_WRITABLE=no to skip writable
  checks in InitObjdir.  Explicit .OBJDIR target always allows
  read-only directory.

o add more unit tests for META MODE

Merge commit '8e11a9b4250be3c3379c45fa820bff78d99d5946' into main

Change-Id: I464fd4c013067f0915671c1ccc96d2d8090b2b9c
2021-01-13 22:21:37 -08:00

25 lines
879 B
Makefile

# $NetBSD: sh-meta-chars.mk,v 1.4 2020/12/07 22:27:56 rillig Exp $
#
# Tests for running shell commands that contain meta-characters.
#
# These meta-characters decide whether the command is run by the shell
# or executed directly via execv, but only in compatibility mode, not
# in jobs mode, and only if MAKE_NATIVE is defined during compilation.
#
# See also:
# Compat_RunCommand, useShell
all:
# The command "exit 0" contains no special characters, therefore it is
# run directly via execv, but only if MAKE_NATIVE is defined.
USING_EXEC!= { echo 'all:; exit 0' | ${MAKE} -r -f - 1>/dev/null 2>&1; } \
&& echo yes || echo no
# It's hard to do any useful tests that result in the same output.
# See SED_CMDS.sh-dots, which normalizes the test output for the specific
# case of the special command '...'.
.if ${USING_EXEC} != "yes" && ${USING_EXEC} != "no"
. error
.endif