sh-dots.mk revision 1.1 1 # $NetBSD: sh-dots.mk,v 1.1 2020/08/22 11:27:02 rillig Exp $
2 #
3 # Tests for the special shell command line "...", which does not run the
4 # commands below it but appends them to the list of commands that are run
5 # at the end.
6
7 all: first hidden repeated commented
8
9 # The ${.TARGET} correctly expands to the target name, even though the
10 # commands are run separately from the main commands.
11 first:
12 @echo first ${.TARGET}
13 ...
14 @echo first delayed ${.TARGET}
15
16 # The dots cannot be prefixed by the usual @-+ characters.
17 # They must be written exactly as dots.
18 hidden: .IGNORE
19 @echo hidden ${.TARGET}
20 @...
21 @echo hidden delayed ${.TARGET}
22
23 # Since the shell command lines don't recognize '#' as comment character,
24 # the "..." is not interpreted specially here.
25 commented: .IGNORE
26 @echo commented ${.TARGET}
27 ... # Run the below commands later
28 @echo commented delayed ${.TARGET}
29
30 # The "..." can appear more than once, even though that doesn't make sense.
31 # The second "..." is a no-op.
32 repeated: .IGNORE
33 @echo repeated ${.TARGET}
34 ...
35 @echo repeated delayed ${.TARGET}
36 ...
37 @echo repeated delayed twice ${.TARGET}
38