make: do not run coverage file unless clean of coverage targets are run
This reduces flat make time by half License: MIT Signed-off-by: Jakub Sztandera <kubuxu@protonmail.ch>
Jakub Sztandera committed
Dec 20, 2016 at 20:56 UTC
730896c006a7e339795d69d91f10d7e0a3eb9aab
2 files changed
+8
-4
Rules.mk
+7
-3
@@ -24,9 +24,13 @@ include $(dir)/Rules.mk
24
dir := cmd/ipfs
25
include $(dir)/Rules.mk
26
27
-# has to be after cmd/ipfs due to PATH
28
-dir := coverage
29
-include $(dir)/Rules.mk
27
+# include this file only if coverage target is executed
28
+# it is quite expensive
29
+ifneq ($(filter coverage% clean,$(MAKECMDGOALS)),)
30
+ # has to be after cmd/ipfs due to PATH
31
+ dir := coverage
32
+ include $(dir)/Rules.mk
33
+endif
34
35
dir := namesys/pb
36
include $(dir)/Rules.mk
coverage/Rules.mk
+1
-1
@@ -32,7 +32,7 @@ $(d)/ipfs: $(d)/main
32
33
CLEAN += $(d)/ipfs
34
35
-ifneq ($(filter coverage,$(MAKECMDGOALS)),)
35
+ifneq ($(filter coverage%,$(MAKECMDGOALS)),)
36
# this is quite hacky but it is best way I could fiture out
37
DEPS_test/sharness += cmd/ipfs/ipfs-test-cover $(d)/coverage_deps $(d)/ipfs
38
endif