suff-rebuild.mk revision 1.5 1 # $NetBSD: suff-rebuild.mk,v 1.5 2020/11/21 11:55:57 rillig Exp $
2 #
3 # Demonstrates what happens to transformation rules (called inference rules
4 # by POSIX) when all suffixes are deleted.
5
6 all: suff-rebuild-example
7
8 .MAKEFLAGS: -dpst
9
10 .SUFFIXES:
11
12 .SUFFIXES: .a .b .c
13
14 suff-rebuild-example.a:
15 : Making ${.TARGET} out of nothing.
16
17 .a.b:
18 : Making ${.TARGET} from ${.IMPSRC}.
19 .b.c:
20 : Making ${.TARGET} from ${.IMPSRC}.
21 .c:
22 : Making ${.TARGET} from ${.IMPSRC}.
23
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.
27 #
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.
30 #
31 #.SUFFIXES:
32
33 # Add the suffixes back. It should not matter that the order of the suffixes
34 # is different from before.
35 .SUFFIXES: .c .b .a
36