summaryrefslogtreecommitdiff
path: root/contrib/bmake/unit-tests/directive-dinclude.mk
blob: c05d1a55f51b3e4b65ed04ed6cacd3276772dcba (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# $NetBSD: directive-dinclude.mk,v 1.5 2025/06/28 22:39:28 rillig Exp $
#
# Tests for the .dinclude directive, which includes another file,
# silently skipping it if it cannot be opened.  This is primarily used for
# including '.depend' files, that's where the 'd' comes from.
#
# 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.

# No complaint that there is no such file.
.dinclude "${.CURDIR}/directive-dinclude-nonexistent.inc"

# No complaint either, even though the operating system error is ENOTDIR, not
# ENOENT.
.dinclude "${MAKEFILE}/subdir"

# Errors that are not related to opening the file are still reported.
# expect: make: directive-dinclude-error.inc:1: Invalid line "syntax error"
_!=	echo 'syntax error' > directive-dinclude-error.inc
.dinclude "${.OBJDIR}/directive-dinclude-error.inc"
_!=	rm directive-dinclude-error.inc

all: .PHONY