2022-02-05 20:03:50 +00:00
|
|
|
# $NetBSD: directive-sinclude.mk,v 1.4 2022/01/23 21:48:59 rillig Exp $
|
2020-11-07 19:39:21 +00:00
|
|
|
#
|
|
|
|
# Tests for the .sinclude directive, which includes another file,
|
|
|
|
# silently skipping it if it cannot be opened.
|
2020-11-20 03:54:37 +00:00
|
|
|
#
|
|
|
|
# The 'silently skipping' only applies to the case where the file cannot be
|
|
|
|
# opened. Parse errors and other errors are handled the same way as in the
|
|
|
|
# other .include directives.
|
2020-11-07 19:39:21 +00:00
|
|
|
|
2022-02-05 20:03:50 +00:00
|
|
|
# No complaint that there is no such file.
|
|
|
|
.sinclude "${.CURDIR}/directive-include-nonexistent.inc"
|
2020-11-07 19:39:21 +00:00
|
|
|
|
2022-02-05 20:03:50 +00:00
|
|
|
# No complaint either, even though the operating system error is ENOTDIR, not
|
|
|
|
# ENOENT.
|
|
|
|
.sinclude "${MAKEFILE}/subdir"
|
|
|
|
|
|
|
|
# Errors that are not related to opening the file are still reported.
|
|
|
|
# expect: make: "directive-include-error.inc" line 1: Invalid line type
|
|
|
|
_!= echo 'syntax error' > directive-include-error.inc
|
|
|
|
.sinclude "${.CURDIR}/directive-include-error.inc"
|
|
|
|
_!= rm directive-include-error.inc
|
|
|
|
|
|
|
|
all: .PHONY
|