2020-11-07 19:39:21 +00:00
|
|
|
# $NetBSD: directive-ifndef.mk,v 1.6 2020/10/24 08:46:08 rillig Exp $
|
2020-09-05 16:11:04 +00:00
|
|
|
#
|
2020-11-07 19:39:21 +00:00
|
|
|
# Tests for the .ifndef directive, which can be used for multiple-inclusion
|
|
|
|
# guards. In contrast to C, where #ifndef and #define nicely line up the
|
|
|
|
# macro name, there is no such syntax in make. Therefore, it is more
|
|
|
|
# common to use .if !defined(GUARD) instead.
|
2020-09-05 16:11:04 +00:00
|
|
|
|
2020-11-07 19:39:21 +00:00
|
|
|
.ifndef GUARD
|
|
|
|
GUARD= # defined
|
|
|
|
. info guarded section
|
|
|
|
.endif
|
|
|
|
|
|
|
|
.ifndef GUARD
|
|
|
|
GUARD= # defined
|
|
|
|
. info guarded section
|
|
|
|
.endif
|
|
|
|
|
|
|
|
.if !defined(GUARD)
|
|
|
|
GUARD= # defined
|
|
|
|
. info guarded section
|
|
|
|
.endif
|
2020-09-05 16:11:04 +00:00
|
|
|
|
|
|
|
all:
|
|
|
|
@:;
|