1 # $NetBSD: deptgt.mk,v 1.9 2020/11/15 11:57:00 rillig Exp $
3 # Tests for special targets like .BEGIN or .SUFFIXES in dependency
8 # Just in case anyone tries to compile several special targets in a single
9 # dependency line: That doesn't work, and make immediately rejects it.
10 .SUFFIXES .PHONY: .c.o
12 # The following lines demonstrate how 'targets' is set and reset during
13 # parsing of dependencies. To see it in action, set breakpoints in:
15 # ParseDoDependency at the beginning
16 # FinishDependencyGroup at "targets = NULL"
17 # Parse_File at "Lst_Free(targets)"
18 # Parse_File at "targets = Lst_New()"
19 # ParseLine_ShellCommand at "targets == NULL"
24 target1 target2: sources # targets := [target1, target2]
25 : command1 # targets == [target1, target2]
26 : command2 # targets == [target1, target2]
27 VAR=value # targets := NULL
28 : command3 # parse error, since targets == NULL
30 # In a dependency declaration, the list of targets can be empty.
31 # It doesn't matter whether the empty string is generated by a variable
32 # expression or whether it is just omitted.
35 : command for empty targets list
37 : command for empty targets list