directive-include-fatal.mk revision 1.2
11.2Srillig# $NetBSD: directive-include-fatal.mk,v 1.2 2020/09/13 10:20:11 rillig Exp $
21.1Srillig#
31.1Srillig# Test for the .include directive combined with fatal errors.
41.1Srillig#
51.1Srillig# At 2020-09-13, the code in Parse_File that sets "fatals = 0" looked
61.1Srillig# suspicious, as if it were possible to suppress fatal errors by including
71.1Srillig# another file.  It was a false alarm though, since Parse_File only handles
81.1Srillig# the top-level makefiles from the command line.  Any included files are
91.1Srillig# handled by Parse_include_file instead, and that function does not reset
101.1Srillig# the "fatals" counter.
111.1Srillig
121.1Srillig# Using an undefined variable in a condition generates a fatal error.
131.1Srillig.if ${UNDEF}
141.1Srillig.endif
151.1Srillig
161.1Srillig# Including another file does not reset the global variable "fatals".
171.1Srillig# The exit status will be 1.
181.1Srillig.include "/dev/null"
191.1Srillig
201.2Srillig# Adding another file to be included has no effect either.
211.2Srillig# When the command line is parsed, the additional file is only enqueued
221.2Srillig# in the global "makefiles" variable, but not immediately run through
231.2Srillig# Parse_File.
241.2Srillig.MAKEFLAGS: -f "/dev/null"
251.2Srillig
261.1Srilligall:
271.1Srillig	@:;
28