xref: /freebsd/contrib/bmake/unit-tests/suff-use.mk (revision 0784121c963e39aa9e8b33c4e0a0c181daf75277)
1# $NetBSD: suff-use.mk,v 1.1 2022/02/07 22:43:50 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#	bin/make-2001.11.12.21.58.18-plain
8#	| : 'Making demo.c out of nothing'
9#	| make: don't know how to make demo.o. Stop
10#	|
11#	| make: stopped in /home/rillig/proj/make-archive
12#	| exit status 2
13#	bin/make-2007.10.11.21.19.28-plain
14#
15#	bin/make-2014.08.23.15.05.40-plain
16#	| : 'Making demo.c out of nothing'
17#	| : 'Compiling demo.c to demo.o'
18#	| exit status 0
19#	bin/make-2014.09.05.06.57.20-plain
20#
21#	bin/make-2014.09.07.20.55.34-plain
22#	| : 'Making demo.c out of nothing'
23#	| make: don't know how to make demo.o. Stop
24#	|
25#	| make: stopped in /home/rillig/proj/make-archive
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