Blame SOURCES/0001-fix-parallel-build-failures.patch

f31040
From 519fd9a5d08d85f3d9cb4192d624fe8351e40232 Mon Sep 17 00:00:00 2001
f31040
From: "Robin H. Johnson" <robbat2@gentoo.org>
f31040
Date: Tue, 23 Jan 2018 17:57:55 -0500
f31040
Subject: [PATCH] fix parallel build failures
f31040
f31040
When building in parallel, the btreplay/btrecord and btreplay/btreplay
f31040
targets cause make to kick off two jobs for `make -C btreplay` and they
f31040
sometimes end up clobbering each other.  We could fix this by making one
f31040
a dependency of the other, but it's a bit cleaner to refactor things to
f31040
be based on subdirs.  This way changes in subdirs also get noticed:
f31040
  $ touch btreplay/*.[ch]
f31040
  $ make
f31040
  <btreplay is now correctly updated>
f31040
f31040
Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
f31040
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
f31040
Signed-off-by: Jens Axboe <axboe@kernel.dk>
f31040
---
f31040
 Makefile | 24 ++++++++++--------------
f31040
 1 file changed, 10 insertions(+), 14 deletions(-)
f31040
f31040
diff --git a/Makefile b/Makefile
f31040
index 68de591..5917814 100644
f31040
--- a/Makefile
f31040
+++ b/Makefile
f31040
@@ -4,23 +4,19 @@ ALL_CFLAGS = $(CFLAGS) -D_GNU_SOURCE -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
f31040
 PROGS	= blkparse blktrace verify_blkparse blkrawverify blkiomon
f31040
 LIBS	= -lpthread
f31040
 SCRIPTS	= btrace
f31040
+SUBDIRS = btreplay btt iowatcher
f31040
 
f31040
-ALL = $(PROGS) $(SCRIPTS) btt/btt btreplay/btrecord btreplay/btreplay \
f31040
+ALL = $(PROGS) $(SCRIPTS)
f31040
+INSTALL_ALL = $(ALL) btt/btt btreplay/btrecord btreplay/btreplay \
f31040
       btt/bno_plot.py iowatcher/iowatcher
f31040
 
f31040
-all: $(ALL)
f31040
+all: $(ALL) $(SUBDIRS)
f31040
 
f31040
-btt/btt:
f31040
-	$(MAKE) -C btt
f31040
-
f31040
-iowatcher/iowatcher:
f31040
-	$(MAKE) -C iowatcher
f31040
-
f31040
-btreplay/btrecord:
f31040
-	$(MAKE) -C btreplay
f31040
-
f31040
-btreplay/btreplay:
f31040
-	$(MAKE) -C btreplay
f31040
+# We always descend into subdirs because they contain their own dependency
f31040
+# information which we don't track in this top level Makefile.
f31040
+$(SUBDIRS):
f31040
+	$(MAKE) -C $@
f31040
+.PHONY: $(SUBDIRS)
f31040
 
f31040
 %.o: %.c
f31040
 	$(CC) -o $*.o -c $(ALL_CFLAGS) $<
f31040
@@ -85,7 +81,7 @@ install: all
f31040
 	$(INSTALL) -m 755 -d $(DESTDIR)$(bindir)
f31040
 	$(INSTALL) -m 755 -d $(DESTDIR)$(mandir)/man1
f31040
 	$(INSTALL) -m 755 -d $(DESTDIR)$(mandir)/man8
f31040
-	$(INSTALL) -m 755 $(ALL) $(DESTDIR)$(bindir)
f31040
+	$(INSTALL) -m 755 $(INSTALL_ALL) $(DESTDIR)$(bindir)
f31040
 	$(INSTALL) -m 644 doc/*.1 $(DESTDIR)$(mandir)/man1
f31040
 	$(INSTALL) -m 644 doc/*.8 $(DESTDIR)$(mandir)/man8
f31040
 
f31040
-- 
f31040
2.25.3
f31040