main shinobi / tests / mk / kati / build_once / test / mk
 1# expect protoc compile/link only once.
 2
 3# Caveat: this test relies on Make and Ninja updating 
 4# the targets in the same order. Make's target update
 5# order is depth first, Ninja's is the first lexically
 6# updatable target. Caution should be taken as Kati reorders
 7# targets.
 8test: foo
 9
10foo: foo.o xbar.o
11	echo link $@ from $<
12
13%.o: %.c FORCE_DO_CMD
14	echo compile $@ from $<
15
16.PHONY: FORCE_DO_CMD
17FORCE_DO_CMD:
18
19foo.c: | protoc
20
21foo.c: foo.proto
22	echo protoc $@ from $<
23
24foo.proto:
25
26xbar.c: | protoc
27
28xbar.c: xbar.proto
29	echo protoc $@ from $<
30
31xbar.proto:
32
33protoc: proto.o
34	echo link $@ from $<
35
36proto.c: