2022-04-03 19:52:08 +00:00
|
|
|
# $NetBSD: directive-elifdef.mk,v 1.4 2022/02/09 21:09:24 rillig Exp $
|
2020-09-05 16:11:04 +00:00
|
|
|
#
|
2022-02-05 20:03:50 +00:00
|
|
|
# Tests for the .elifdef directive, which is seldom used. Instead of writing
|
2022-04-03 19:52:08 +00:00
|
|
|
# '.elifdef VAR', the usual form is the more general '.elif defined(VAR)'.
|
2020-09-05 16:11:04 +00:00
|
|
|
|
2022-02-05 20:03:50 +00:00
|
|
|
# At this point, VAR is not defined, so the condition evaluates to false.
|
|
|
|
.if 0
|
|
|
|
.elifdef VAR
|
|
|
|
. error
|
|
|
|
.endif
|
|
|
|
|
|
|
|
VAR= # defined
|
|
|
|
|
|
|
|
# At this point, VAR is defined, so the condition evaluates to true.
|
|
|
|
.if 0
|
|
|
|
.elifdef VAR
|
|
|
|
.else
|
|
|
|
. error
|
|
|
|
.endif
|
2020-09-05 16:11:04 +00:00
|
|
|
|
|
|
|
all:
|