Home | History | Annotate | Line # | Download | only in unit-tests
deptgt-makeflags.mk revision 1.3
      1  1.3  rillig # $NetBSD: deptgt-makeflags.mk,v 1.3 2020/09/10 21:22:07 rillig Exp $
      2  1.1  rillig #
      3  1.3  rillig # Tests for the special target .MAKEFLAGS in dependency declarations,
      4  1.3  rillig # which adds command line options later, at parse time.
      5  1.1  rillig 
      6  1.3  rillig # The -D option sets a variable in the "Global" scope and thus can be
      7  1.3  rillig # undefined later.
      8  1.3  rillig .MAKEFLAGS: -D VAR
      9  1.3  rillig 
     10  1.3  rillig .if ${VAR} != 1
     11  1.3  rillig .  error
     12  1.3  rillig .endif
     13  1.3  rillig 
     14  1.3  rillig .undef VAR
     15  1.3  rillig 
     16  1.3  rillig .if defined(VAR)
     17  1.3  rillig .  error
     18  1.3  rillig .endif
     19  1.3  rillig 
     20  1.3  rillig .MAKEFLAGS: -D VAR
     21  1.3  rillig 
     22  1.3  rillig .if ${VAR} != 1
     23  1.3  rillig .  error
     24  1.3  rillig .endif
     25  1.3  rillig 
     26  1.3  rillig .MAKEFLAGS: VAR="value"' with'\ spaces
     27  1.3  rillig 
     28  1.3  rillig .if ${VAR} != "value with spaces"
     29  1.3  rillig .  error
     30  1.3  rillig .endif
     31  1.3  rillig 
     32  1.3  rillig # Variables set on the command line as VAR=value are placed in the
     33  1.3  rillig # "Command" scope and thus cannot be undefined.
     34  1.3  rillig .undef VAR
     35  1.3  rillig 
     36  1.3  rillig .if ${VAR} != "value with spaces"
     37  1.3  rillig .  error
     38  1.3  rillig .endif
     39  1.1  rillig 
     40  1.1  rillig all:
     41  1.1  rillig 	@:;
     42