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