impsrc.mk revision 292068
1# $NetBSD: impsrc.mk,v 1.2 2014/08/30 22:21:07 sjg Exp $
2
3# Does ${.IMPSRC} work properly?
4# It should be set, in order of precedence, to ${.TARGET} of:
5#  1) the implied source of a transformation rule,
6#  2) the first prerequisite from the dependency line of an explicit rule, or
7#  3) the first prerequisite of an explicit rule.
8#
9
10all: target1.z target2 target3 target4
11
12.SUFFIXES: .x .y .z
13
14.x.y: source1
15	@echo 'expected: target1.x'
16	@echo 'actual:   $<'
17
18.y.z: source2
19	@echo 'expected: target1.y'
20	@echo 'actual:   $<'
21
22target1.y: source3
23
24target1.x: source4
25	@echo 'expected: source4'
26	@echo 'actual:   $<'
27
28target2: source1 source2
29	@echo 'expected: source1'
30	@echo 'actual:   $<'
31
32target3: source1
33target3: source2 source3
34	@echo 'expected: source2'
35	@echo 'actual:   $<'
36
37target4: source1
38target4:
39	@echo 'expected: source1'
40	@echo 'actual:   $<'
41
42source1 source2 source3 source4:
43
44