mirror of
https://github.com/freebsd/freebsd-src
synced 2024-07-22 10:48:02 +00:00
![Simon J. Gerraty](/assets/img/avatar_default.png)
o allow env var MAKE_OBJDIR_CHECK_WRITABLE=no to skip writable checks in InitObjdir. Explicit .OBJDIR target always allows read-only directory. o Fix building and unit-tests on non-BSD. o More code cleanup and refactoring. o More unit tests
45 lines
1 KiB
Makefile
45 lines
1 KiB
Makefile
# $NetBSD: envfirst.mk,v 1.4 2020/11/09 20:50:56 rillig Exp $
|
|
#
|
|
# The -e option makes environment variables stronger than global variables.
|
|
|
|
.MAKEFLAGS: -e
|
|
|
|
.if ${FROM_ENV} != value-from-env
|
|
. error ${FROM_ENV}
|
|
.endif
|
|
|
|
# Try to override the variable; this does not have any effect.
|
|
FROM_ENV= value-from-mk
|
|
.if ${FROM_ENV} != value-from-env
|
|
. error ${FROM_ENV}
|
|
.endif
|
|
|
|
# Try to append to the variable; this also doesn't have any effect.
|
|
FROM_ENV+= appended
|
|
.if ${FROM_ENV} != value-from-env
|
|
. error ${FROM_ENV}
|
|
.endif
|
|
|
|
# The default assignment also cannot change the variable.
|
|
FROM_ENV?= default
|
|
.if ${FROM_ENV} != value-from-env
|
|
. error ${FROM_ENV}
|
|
.endif
|
|
|
|
# Neither can the assignment modifiers.
|
|
.if ${FROM_ENV::=from-condition}
|
|
.endif
|
|
.if ${FROM_ENV} != value-from-env
|
|
. error ${FROM_ENV}
|
|
.endif
|
|
|
|
# Even .undef doesn't work since it only affects the global context,
|
|
# which is independent from the environment variables.
|
|
.undef FROM_ENV
|
|
.if ${FROM_ENV} != value-from-env
|
|
. error ${FROM_ENV}
|
|
.endif
|
|
|
|
all:
|
|
@: nothing
|