1 # $NetBSD: suff-rebuild.mk,v 1.6 2020/11/21 12:01:16 rillig Exp $
3 # Demonstrates what happens to transformation rules (called inference rules
4 # by POSIX) when all suffixes are deleted.
6 all: suff-rebuild-example
14 suff-rebuild-example.a:
15 : Making ${.TARGET} out of nothing.
18 : Making ${.TARGET} from ${.IMPSRC}.
20 : Making ${.TARGET} from ${.IMPSRC}.
22 : Making ${.TARGET} from ${.IMPSRC}.
24 # XXX: At a quick glance, the code in SuffUpdateTarget looks as if it were
25 # possible to delete the suffixes in the middle of the makefile, add back
26 # the suffixes from before, and have the transformation rules preserved.
28 # As of 2020-09-25, uncommenting the following line results in the error
29 # message "don't know how to make suff-rebuild-example" though.
31 # If this is a bug, the actual cause is probably that when a suffix
32 # transformation rule is defined, it is not added to the global list of
33 # targets, see Suff_EndTransform. Later, UpdateTargets iterates over exactly
34 # this global list of targets though.
36 # If UpdateTargets were to iterate over 'transforms' as well, it still
37 # wouldn't work because the condition 'ptr == target->name' skips these
38 # transformation rules.
42 # Add the suffixes back. It should not matter that the order of the suffixes
43 # is different from before.