directive.mk revision 1.5
11.5Srillig# $NetBSD: directive.mk,v 1.5 2021/12/13 23:38:54 rillig Exp $ 21.1Srillig# 31.2Srillig# Tests for the preprocessing directives, such as .if or .info. 41.1Srillig 51.1Srillig# TODO: Implementation 61.1Srillig 71.3Srillig# Unknown directives are correctly named in the error messages, 81.3Srillig# even if they are indented. 91.3Srillig.indented none 101.3Srillig. indented 2 spaces 111.3Srillig. indented tab 121.3Srillig 131.3Srillig# Directives must be written directly, not indirectly via variable 141.3Srillig# expressions. 151.3Srillig.${:Uinfo} directives cannot be indirect 161.3Srillig 171.4Srillig# There is no directive called '.target', therefore this is parsed as a 181.4Srillig# dependency declaration with 2 targets and 1 source. 191.4Srillig.target target: source 201.4Srillig 211.4Srillig# This looks ambiguous. It could be either an .info message or a variable 221.4Srillig# assignment. It is a variable assignment. 231.4Srillig.MAKEFLAGS: -dv 241.4Srillig.info:= value 251.4Srillig.info?= value # This is a variable assignment as well. 261.4Srillig.info := value # The space after the '.info' makes this 271.4Srillig # a directive. 281.4Srillig.MAKEFLAGS: -d0 291.4Srillig 301.4Srillig# This is a dependency since directives must be given directly. 311.4Srillig# Not even the space after the '.info' can change anything about this. 321.4Srillig.${:Uinfo} : source 331.4Srillig 341.5Srillig# expect+1: Invalid line type 351.5Srilligtarget-without-colon 361.5Srillig 371.5Srillig# expect+1: Invalid line type 381.5Srilligtarget-without-colon another-target 39