xref: /freebsd/contrib/bmake/unit-tests/sh-jobs.mk (revision b0c40a00a67f611868fc0f10bde6b28eb75931be)
1# $NetBSD: sh-jobs.mk,v 1.4 2021/04/16 16:49:27 rillig Exp $
2#
3# Tests for the "run in jobs mode" part of the "Shell Commands" section
4# from the manual page.
5
6# TODO: Tutorial
7
8.MAKEFLAGS: -j1
9
10all: .PHONY comment .WAIT comment-with-followup-line .WAIT no-comment
11
12# If a shell command starts with a comment character after stripping the
13# leading '@', it is run in ignore-errors mode since the default runChkTmpl
14# would lead to a syntax error in the generated shell file, at least for
15# bash and dash, but not for NetBSD sh and ksh.
16#
17# See JobWriteCommand, cmdTemplate, runIgnTmpl
18comment: .PHONY
19	@# comment
20
21# If a shell command starts with a comment character after stripping the
22# leading '@', it is run in ignore-errors mode.
23#
24# See JobWriteCommand, cmdTemplate, runIgnTmpl
25comment-with-followup-line: .PHONY
26	@# comment${.newline}echo '$@: This is printed.'; false
27	@true
28
29# Without the comment, the commands are run in the default mode, which checks
30# the exit status of every makefile line.
31#
32# See JobWriteCommand, cmdTemplate, runChkTmpl
33no-comment: .PHONY
34	@echo '$@: This is printed.'; false
35	@true
36