List for cgit developers and users
 help / color / mirror / Atom feed
* [PATCH] Makefile: fix parallel "make test"
@ 2013-05-18 14:17 john
  2013-05-18 15:03 ` Jason
  0 siblings, 1 reply; 2+ messages in thread
From: john @ 2013-05-18 14:17 UTC (permalink / raw)


When building the "test" target we depend on both cgit and building the
Git tools.  By doing this with two targets we end up running make in the
git/ directory twice, concurrently if using parallel make, which causes
us to build more than we need and potentially builds incorrectly if
multi-step build-then-move operations overlap.

Fix this by instead calling back into the makefile so that we alter the
"cgit" target to also build the Git tools.

Signed-off-by: John Keeping <john at keeping.me.uk>
---
 Makefile | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/Makefile b/Makefile
index 77c676d..0fe0bc2 100644
--- a/Makefile
+++ b/Makefile
@@ -64,12 +64,10 @@ endif
 all:: cgit
 
 cgit:
-	$(QUIET_SUBDIR0)git $(QUIET_SUBDIR1) -f ../cgit.mk ../cgit NO_CURL=1
+	$(QUIET_SUBDIR0)git $(QUIET_SUBDIR1) -f ../cgit.mk ../cgit $(EXTRA_GIT_TARGETS) NO_CURL=1
 
-git:
-	$(QUIET_SUBDIR0)git $(QUIET_SUBDIR1) NO_CURL=1
-
-test: all git
+test:
+	@$(MAKE) --no-print-directory cgit EXTRA_GIT_TARGETS=all
 	$(QUIET_SUBDIR0)tests $(QUIET_SUBDIR1) all
 
 install: all
-- 
1.8.3.rc2.285.gfc18c2c



^ permalink raw reply	[flat|nested] 2+ messages in thread

* [PATCH] Makefile: fix parallel "make test"
  2013-05-18 14:17 [PATCH] Makefile: fix parallel "make test" john
@ 2013-05-18 15:03 ` Jason
  0 siblings, 0 replies; 2+ messages in thread
From: Jason @ 2013-05-18 15:03 UTC (permalink / raw)


Merged to wip. Thanks.


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2013-05-18 15:03 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-05-18 14:17 [PATCH] Makefile: fix parallel "make test" john
2013-05-18 15:03 ` Jason

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).