xref: /freebsd/contrib/bmake/unit-tests/dir.mk (revision ae41709ab46305df80f7f35bb478a3c8ebf22ebb)
1# $NetBSD: dir.mk,v 1.4 2020/07/31 20:16:21 rillig Exp $
2#
3# Tests for dir.c.
4
5# Dependency lines may use braces for expansion.
6all: {one,two,three}
7
8one:
9	@echo 1
10two:
11	@echo 2
12three:
13	@echo 3
14
15# The braces may start in the middle of a word.
16all: f{our,ive}
17
18four:
19	@echo 4
20five:
21	@echo 5
22six:
23	@echo 6
24
25# But nested braces don't work.
26all: {{thi,fou}r,fif}teen
27
28thirteen:
29	@echo 13
30fourteen:
31	@echo 14
32fifteen:
33	@echo 15
34
35# There may be multiple brace groups side by side.
36all: {pre-,}{patch,configure}
37
38pre-patch patch pre-configure configure:
39	@echo $@
40
41# Empty pieces are allowed in the braces.
42all: {fetch,extract}{,-post}
43
44fetch fetch-post extract extract-post:
45	@echo $@
46
47# The expansions may have duplicates.
48# These are merged together because of the dependency line.
49all: dup-{1,1,1,1,1,1,1}
50
51dup-1:
52	@echo $@
53
54# Other than in Bash, the braces are also expanded if there is no comma.
55all: {{{{{{{{{{single-word}}}}}}}}}}
56
57single-word:
58	@echo $@
59