2021-02-11 01:51:11 +00:00
|
|
|
# $NetBSD: directive-include-fatal.mk,v 1.3 2021/02/01 22:16:57 rillig Exp $
|
2020-11-07 19:39:21 +00:00
|
|
|
#
|
|
|
|
# Test for the .include directive combined with fatal errors.
|
|
|
|
#
|
|
|
|
# At 2020-09-13, the code in Parse_File that sets "fatals = 0" looked
|
|
|
|
# suspicious, as if it were possible to suppress fatal errors by including
|
|
|
|
# another file. It was a false alarm though, since Parse_File only handles
|
|
|
|
# the top-level makefiles from the command line. Any included files are
|
2021-02-11 01:51:11 +00:00
|
|
|
# handled by IncludeFile instead, and that function does not reset
|
2020-11-07 19:39:21 +00:00
|
|
|
# the "fatals" counter.
|
|
|
|
|
|
|
|
# Using an undefined variable in a condition generates a fatal error.
|
|
|
|
.if ${UNDEF}
|
|
|
|
.endif
|
|
|
|
|
|
|
|
# Including another file does not reset the global variable "fatals".
|
|
|
|
# The exit status will be 1.
|
|
|
|
.include "/dev/null"
|
|
|
|
|
|
|
|
# Adding another file to be included has no effect either.
|
|
|
|
# When the command line is parsed, the additional file is only enqueued
|
|
|
|
# in the global "makefiles" variable, but not immediately run through
|
|
|
|
# Parse_File.
|
|
|
|
.MAKEFLAGS: -f "/dev/null"
|
|
|
|
|
|
|
|
all:
|
|
|
|
@:;
|