]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - contrib/bmake/unit-tests/directive-ifndef.mk
Update to bmake-20201101
[FreeBSD/FreeBSD.git] / contrib / bmake / unit-tests / directive-ifndef.mk
1 # $NetBSD: directive-ifndef.mk,v 1.6 2020/10/24 08:46:08 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         @:;