xref: /freebsd/contrib/bmake/unit-tests/depsrc-nopath.mk (revision 548bfc56eb0b2cefa0fb8dc2478240bfef610309)
1# $NetBSD: depsrc-nopath.mk,v 1.3 2024/04/27 20:41:32 rillig Exp $
2#
3# Tests for the special source .NOPATH in dependency declarations.
4
5.if !target(test-*)
6_!=	rm -rf depsrc-nopath.dir
7_!=	mkdir depsrc-nopath.dir
8_!=	touch depsrc-nopath.dir/regular.file
9_!=	touch depsrc-nopath.dir/nopath.file
10.endif
11
12all:
13	@${MAKE} -f ${MAKEFILE} test-regular
14	@${MAKE} -f ${MAKEFILE} test-nopath || echo "should have failed"
15	@rm -rf depsrc-nopath.dir
16
17.PATH: depsrc-nopath.dir
18
19test-regular: regular.file
20	: Making ${.TARGET} from ${.ALLSRC}
21test-nopath: nopath.file
22	: Making ${.TARGET} from ${.ALLSRC}
23
24nopath.file: .NOPATH
25
26# expect: : Making test-regular from depsrc-nopath.dir/regular.file
27# expect: : Making test-nopath from nopath.file
28