mirror of
https://github.com/opnsense/src.git
synced 2026-04-22 06:39:32 -04:00
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.
34 lines
693 B
Makefile
34 lines
693 B
Makefile
# $NetBSD: cond-token-var.mk,v 1.3 2020/08/20 19:43:42 rillig Exp $
|
|
#
|
|
# Tests for variables in .if conditions.
|
|
|
|
DEF= defined
|
|
|
|
# A defined variable may appear on either side of the comparison.
|
|
.if ${DEF} == ${DEF}
|
|
.info ok
|
|
.else
|
|
.error
|
|
.endif
|
|
|
|
# A variable that appears on the left-hand side must be defined.
|
|
.if ${UNDEF} == ${DEF}
|
|
.error
|
|
.endif
|
|
|
|
# A variable that appears on the right-hand side must be defined.
|
|
.if ${DEF} == ${UNDEF}
|
|
.error
|
|
.endif
|
|
|
|
# A defined variable may appear as an expression of its own.
|
|
.if ${DEF}
|
|
.endif
|
|
|
|
# An undefined variable generates a warning.
|
|
.if ${UNDEF}
|
|
.endif
|
|
|
|
# The :U modifier turns an undefined variable into an ordinary expression.
|
|
.if ${UNDEF:U}
|
|
.endif
|