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