Home | History | Annotate | Line # | Download | only in unit-tests
varname-makeflags.mk revision 1.3
      1  1.3  rillig # $NetBSD: varname-makeflags.mk,v 1.3 2020/12/01 20:37:30 rillig Exp $
      2  1.1  rillig #
      3  1.3  rillig # Tests for the special MAKEFLAGS variable, which is basically just a normal
      4  1.3  rillig # environment variable.  It is closely related to .MAKEFLAGS but captures the
      5  1.3  rillig # state of .MAKEFLAGS at the very beginning of make, before any makefiles are
      6  1.3  rillig # read.
      7  1.1  rillig 
      8  1.1  rillig # TODO: Implementation
      9  1.1  rillig 
     10  1.3  rillig .MAKEFLAGS: -d0
     11  1.3  rillig 
     12  1.3  rillig # The unit tests are run with an almost empty environment.  In particular,
     13  1.3  rillig # the variable MAKEFLAGS is not set.  The '.MAKEFLAGS:' above also doesn't
     14  1.3  rillig # influence the environment variable MAKEFLAGS, therefore it is still
     15  1.3  rillig # undefined at this point.
     16  1.3  rillig .if ${MAKEFLAGS:Uundefined} != "undefined"
     17  1.3  rillig .  error
     18  1.3  rillig .endif
     19  1.3  rillig 
     20  1.3  rillig # The special variable .MAKEFLAGS is influenced though.
     21  1.3  rillig # See varname-dot-makeflags.mk for more details.
     22  1.3  rillig .if ${.MAKEFLAGS} != " -r -k -d 0"
     23  1.3  rillig .  error
     24  1.3  rillig .endif
     25  1.3  rillig 
     26  1.1  rillig all:
     27