b867386
From f4f8ef7cdea138cfaa2f3ca0ee31fa23d3bcf1cc Mon Sep 17 00:00:00 2001
b867386
From: Gwendal Grignou <gwendal@chromium.org>
b867386
Date: Thu, 16 Jan 2020 12:33:26 -0800
b867386
Subject: [PATCH] fix parallel build of btt and blkiomon
b867386
b867386
rbtree.c is used by both binaries. It is possible that when make -C btt
b867386
is invoked rbtree.o does not exist yet, but is already schedule by the
b867386
compilation of blkiomon. That could result in recompiling rbtree.o again
b867386
for btt/btt.
b867386
In that case, at install time, make will recompile blkiomon which can
b867386
fail in gentoo, because CC variable is not overriden by ebuild script at
b867386
install time. (see https://bugs.gentoo.org/705594)
b867386
b867386
Add a dependency on SUBDIRS to wait for all binary in . to be compiled.
b867386
It will guarante rbtree.o exists.
b867386
b867386
Signed-off-by: Gwendal Grignou <gwendal@chromium.org>
b867386
Signed-off-by: Jens Axboe <axboe@kernel.dk>
b867386
---
b867386
 Makefile | 2 +-
b867386
 1 file changed, 1 insertion(+), 1 deletion(-)
b867386
b867386
diff --git a/Makefile b/Makefile
b867386
index 5917814..eb3c6a1 100644
b867386
--- a/Makefile
b867386
+++ b/Makefile
b867386
@@ -14,7 +14,7 @@ all: $(ALL) $(SUBDIRS)
b867386
 
b867386
 # We always descend into subdirs because they contain their own dependency
b867386
 # information which we don't track in this top level Makefile.
b867386
-$(SUBDIRS):
b867386
+$(SUBDIRS): $(PROGS)
b867386
 	$(MAKE) -C $@
b867386
 .PHONY: $(SUBDIRS)
b867386
 
b867386
-- 
b867386
2.25.3
b867386