aboutsummaryrefslogtreecommitdiff
path: root/contrib/bmake/unit-tests/suff-main-several.mk
blob: bcc21db5e128002595db1978bce1900a00067f1f (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
# $NetBSD: suff-main-several.mk,v 1.1 2020/11/22 20:36:17 rillig Exp $
#
# Demonstrate that an inference rule is considered the main target if its
# suffixes are not known at the point of declaration.

.MAKEFLAGS: -dmps

.1.2 .1.3 .1.4:
	: Making ${.TARGET} from ${.IMPSRC}.

# At this point, the above targets are normal targets.
# The target '.1.2' is now the default main target.

next-main:
	: Making ${.TARGET}

# At this point, 'next-main' is just a regular target.

.SUFFIXES: .1 .2 .3 .4

# Since the targets '.1.2', '.1.3' and '.1.4' have now been turned into
# transformation rules, 'next-main' is the default main target now.

.SUFFIXES: # clear all

# At this point, 'next-main' is still the default main target, even though
# it is not the first regular target anymore.

# Define and undefine the suffixes, changing their order.
# XXX: This should have no effect, but as of 2020-11-22, it does.
# For some reason, mentioning the suffixes in reverse order disables them.
.SUFFIXES: .4 .3 .2 .1
.SUFFIXES: # none
.SUFFIXES: .1 .2 .3 .4
.SUFFIXES: # none
.SUFFIXES: .4 .3 .2 .1

suff-main-several.1:
	: Making ${.TARGET} out of nothing.
next-main: suff-main-several.{2,3,4}

.MAKEFLAGS: -d0 -dg1