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