summaryrefslogtreecommitdiff
path: root/usr.bin/make/unit-tests/suff-lookup.mk
blob: f45dfbd9211158c1f0f7211e123a7672f13e35cc (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
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
# $NetBSD: suff-lookup.mk,v 1.2 2020/10/24 03:18:22 rillig Exp $
#
# Demonstrate name resolution for suffixes.
#
# See also:
#	FindSuffByName

.MAKEFLAGS: -ds

all: suff-lookup.cc

.SUFFIXES: .c .cc .ccc

# Register '.short' before '.sho'.  When searching for the transformation
# '.sho.c', the suffix '.short' must not be found even though it starts with
# the correct characters.
.SUFFIXES: .short .sho .dead-end

# From long to short suffix.
.ccc.cc:
	: 'Making ${.TARGET} from ${.IMPSRC}.'

# From short to long suffix.
.c.ccc:
	: 'Making ${.TARGET} from ${.IMPSRC}.'

.short.c:
	: 'Making ${.TARGET} from ${.IMPSRC}.'
.sho.c:
	: 'Making ${.TARGET} from ${.IMPSRC}.'
.dead-end.short:
	: 'Making ${.TARGET} from ${.IMPSRC}.'

suff-lookup.sho:
	: 'Making ${.TARGET} out of nothing.'

# Deleting all suffixes and adding them again rebuilds all of the above
# transformation rules.
.SUFFIXES:
.SUFFIXES: .c .cc .ccc .short .sho .dead-end