xref: /freebsd/contrib/bmake/unit-tests/suff-use.mk (revision af23369a6deaaeb612ab266eb88b8bb8d560c322)
1# $NetBSD: suff-use.mk,v 1.2 2022/02/09 21:09:24 rillig Exp $
2#
3# This test combines a .USE node with suffix rules, trying to add an
4# additional command before and after successful compilation of a .c file.
5#
6# History:
7#	make-2001.11.12.21.58.18
8#	| : 'Making demo.c out of nothing'
9#	| make: don't know how to make demo.o. Stop
10#	|
11#	| make: stopped in <curdir>
12#	| exit status 2
13#	make-2007.10.11.21.19.28
14#
15#	make-2014.08.23.15.05.40
16#	| : 'Making demo.c out of nothing'
17#	| : 'Compiling demo.c to demo.o'
18#	| exit status 0
19#	make-2014.09.05.06.57.20
20#
21#	make-2014.09.07.20.55.34
22#	| : 'Making demo.c out of nothing'
23#	| make: don't know how to make demo.o. Stop
24#	|
25#	| make: stopped in <curdir>
26#	| exit status 2
27#	...
28#
29# See also:
30#	https://gnats.netbsd.org/20993
31
32
33.SUFFIXES: .c .o
34
35all: demo.o
36
37.c.o:
38	: 'Compiling ${.IMPSRC} to ${.TARGET}'
39
40demo.c:
41	: 'Making ${.TARGET} out of nothing'
42
43using-before: .USEBEFORE
44	: 'Before making ${.TARGET} from ${.ALLSRCS}'
45
46using-after: .USE
47	: 'After making ${.TARGET} from ${.ALLSRCS}'
48
49# expect: make: don't know how to make demo.o (continuing)
50.c.o: using-before using-after
51