Merge branch 'master' of git://repo.or.cz/unleashed into uadmin
[unleashed.git] / bin / make / unit-tests / suffixes.mk
blob113484a590af399224d5dec9f5f0db9d6a8c3acc
1 # $NetBSD: suffixes.mk,v 1.3 2014/08/30 22:21:08 sjg Exp $
3 # Issues from PR 49086
5 # Issue 3: single suffix rules remain active after .SUFFIXES is cleared
7 # There's a rule for issue3.a, but .a is no longer a known suffix when
8 # targets are being made, so issue3 should not get made.
9 all: issue3
11 # Issue 4: suffix rules do not become regular rules when .SUFFIXES is cleared
13 # When the rules were encountered, .a and .b were known suffices, but later
14 # on they were forgotten. These should get created as regular targets.
15 all: .a .a.b .b.a
17 # Issue 5: adding more suffixes does not make existing rules into suffix rules
19 # When the targets .c.d, .d.c, .d, .d.e, and .e.d were encountered, only .a,
20 # .b and .c were known suffixes, so all of them were regular rules. Later
21 # rest of the suffixes were made known, so they should all be suffix
22 # transformation rules.
23 all: issue5a.d issue5b.c issue5c issue5d.e issue5e.d
25 # Issue 6: transformation search can end up in an infinite loop
27 # There is no file or target from which issue6.f could be made from so
28 # this should fail. The bug was that because rules .e.f, .d.e and .e.d
29 # exist, make would try to make .f from .e and then infinitely try
30 # to do .e from .d and vice versa.
31 all: issue6.f
33 # Issue 10: explicit dependencies affect transformation rule selection
35 # If issue10.e is wanted and both issue10.d and issue10.f are available,
36 # make should choose the .d.e rule, because .d is before .f in .SUFFIXES.
37 # The bug was that if issue10.d had an explicit dependency on issue10.f,
38 # it would choose .f.e instead.
39 all: issue10.e
41 # Issue 11: sources from transformation rules are expanded incorrectly
43 # issue11.j should depend on issue11.i and issue11.second and issue11.i
44 # should depend on issue11.h and issue11.first. The bug was that
45 # the dynamic sources were expanded before ${.PREFIX} and ${.TARGET} were
46 # available, so they would have expanded to a null string.
47 all: issue11.j
49 # we need to clean for repeatable results
50 .BEGIN: clean
51 clean:
52 @rm -f issue* .[ab]*
54 .SUFFIXES: .a .b .c
56 .a .a.b .b.a:
57 @echo 'There should be no text after the colon: ${.IMPSRC}'
58 touch ${.TARGET}
60 .c.d .d.c .d .d.e .e.d:
61 @echo 'first set'
62 cp ${.IMPSRC} ${.TARGET}
64 .SUFFIXES:
65 .SUFFIXES: .c .d .e .f .g
67 .e .e.f .f.e:
68 @echo 'second set'
69 cp ${.IMPSRC} ${.TARGET}
71 issue3.a:
72 @echo 'There is a bug if you see this.'
73 touch ${.TARGET}
75 issue5a.c issue5b.d issue5c.d issue5d.d issue5e.e issue10.d issue10.f:
76 touch ${.TARGET}
78 .SUFFIXES: .h .i .j
80 .h.i: ${.PREFIX}.first
81 @echo '.ALLSRC: ${.ALLSRC}'
82 cp ${.IMPSRC} ${.TARGET}
84 .i.j: ${.PREFIX}.second
85 @echo '.ALLSRC: ${.ALLSRC}'
86 cp ${.IMPSRC} ${.TARGET}
88 issue11.h issue11.first issue11.second:
89 touch ${.TARGET}