xref: /freebsd/contrib/bmake/unit-tests/shell-csh.mk (revision 43a5ec4eb41567cc92586503212743d89686d78f)
1# $NetBSD: shell-csh.mk,v 1.8 2021/04/04 09:58:51 rillig Exp $
2#
3# Tests for using a C shell for running the commands.
4
5CSH!=	which csh 2> /dev/null || true
6
7# The shell path must be an absolute path.
8# This is only obvious in parallel mode since in compat mode,
9# simple commands are executed via execve directly.
10.if ${CSH} != ""
11.SHELL: name="csh" path="${CSH}"
12.endif
13
14# In parallel mode, the shell->noPrint command is filtered from
15# the output, rather naively (in PrintOutput).
16#
17# Until 2020-10-03, the output in parallel mode was garbled because
18# the definition of the csh had been wrong since 1993 at least.
19.MAKEFLAGS: -j1
20
21all:
22.if ${CSH} != ""
23	# This command is both printed and executed.
24	echo normal
25
26	# This command is only executed.
27	@echo hidden
28
29	# This command is both printed and executed.
30	+echo always
31
32	# This command is both printed and executed.
33	-echo ignore errors
34
35	# In the C shell, "unset verbose" is set as the noPrint command.
36	# Therefore it is filtered from the output, rather naively.
37	@echo 'They chatted in the sunset verbosely.'
38.else
39	@sed '$$d' ${MAKEFILE:.mk=.exp}	# This is cheated.
40.endif
41