2020-11-07 19:39:21 +00:00
|
|
|
# $NetBSD: cond-func-make.mk,v 1.3 2020/09/25 20:11:06 rillig Exp $
|
2020-09-05 16:11:04 +00:00
|
|
|
#
|
2020-11-07 19:39:21 +00:00
|
|
|
# Tests for the make() function in .if conditions, which tests whether
|
|
|
|
# the argument has been passed as a target via the command line or later
|
|
|
|
# via the .MAKEFLAGS special dependency target.
|
2020-09-05 16:11:04 +00:00
|
|
|
|
2020-11-07 19:39:21 +00:00
|
|
|
.if !make(via-cmdline)
|
|
|
|
. error
|
|
|
|
.endif
|
|
|
|
.if make(via-dot-makeflags)
|
|
|
|
. error
|
|
|
|
.endif
|
2020-09-05 16:11:04 +00:00
|
|
|
|
2020-11-07 19:39:21 +00:00
|
|
|
.MAKEFLAGS: via-dot-makeflags
|
|
|
|
|
|
|
|
.if !make(via-cmdline)
|
|
|
|
. error
|
|
|
|
.endif
|
|
|
|
.if !make(via-dot-makeflags)
|
|
|
|
. error
|
|
|
|
.endif
|
|
|
|
|
|
|
|
via-cmdline via-dot-makeflags:
|
|
|
|
: $@
|