Home | History | Annotate | Line # | Download | only in unit-tests
directive-ifndef.mk revision 1.5
      1 # $NetBSD: directive-ifndef.mk,v 1.5 2020/10/05 19:27:48 rillig Exp $
      2 #
      3 # Tests for the .ifndef directive, which can be used for multiple-inclusion
      4 # guards.  In contrast to C, where #ifndef and #define nicely line up the
      5 # macro name, there is no such syntax in make.  Therefore, it is more
      6 # common to use .if !defined(GUARD) instead.
      7 
      8 .ifndef GUARD
      9 GUARD=	# defined
     10 .info guarded section
     11 .endif
     12 
     13 .ifndef GUARD
     14 GUARD=	# defined
     15 .info guarded section
     16 .endif
     17 
     18 .if !defined(GUARD)
     19 GUARD=	# defined
     20 .info guarded section
     21 .endif
     22 
     23 all:
     24 	@:;
     25