]> gitweb.ps.run Git - ps-cgit/commitdiff
Makefile: fix parallel "make test"
authorJohn Keeping <john@keeping.me.uk>
Sat, 18 May 2013 14:17:08 +0000 (15:17 +0100)
committerJason A. Donenfeld <Jason@zx2c4.com>
Wed, 22 May 2013 10:53:06 +0000 (12:53 +0200)
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@keeping.me.uk>
Makefile

index 77c676dd0f779887a64fc114b672539482cd7f80..0fe0bc21d94f29efa694deccc1024b8644e8d2a1 100644 (file)
--- 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