2c3632d14f
Lots of code refactoring, simplification and cleanup. Lots of new unit-tests providing much higher code coverage. All courtesy of rillig at netbsd. Other significant changes: o new read-only variable .SHELL which provides the path of the shell used to run scripts (as defined by the .SHELL target). o variable parsing detects more errors. o new debug option -dl: LINT mode, does the equivalent of := for all variable assignments so that file and line number are reported for variable parse errors.
43 lines
919 B
Makefile
43 lines
919 B
Makefile
# $NetBSD: cond-func-exists.mk,v 1.4 2020/08/28 12:59:36 rillig Exp $
|
|
#
|
|
# Tests for the exists() function in .if conditions.
|
|
|
|
.if !exists(.)
|
|
.error
|
|
.endif
|
|
|
|
# The argument to the function must not be enclosed in quotes.
|
|
# Neither double quotes nor single quotes are allowed.
|
|
.if exists(".")
|
|
.error
|
|
.endif
|
|
|
|
.if exists('.')
|
|
.error
|
|
.endif
|
|
|
|
# The only way to escape characters that would otherwise influence the parser
|
|
# is to enclose them in a variable expression. For function arguments,
|
|
# neither the backslash nor the dollar sign act as escape character.
|
|
.if exists(\.)
|
|
.error
|
|
.endif
|
|
|
|
.if !exists(${:U.})
|
|
.error
|
|
.endif
|
|
|
|
# The argument to the function can have several variable expressions.
|
|
# See cond-func.mk for the characters that cannot be used directly.
|
|
.if !exists(${.PARSEDIR}/${.PARSEFILE})
|
|
.error
|
|
.endif
|
|
|
|
# Whitespace is trimmed on both sides of the function argument.
|
|
.if !exists( . )
|
|
.error
|
|
.endif
|
|
|
|
all:
|
|
@:;
|