From 7be60c9b131a0d0153001b3920f3eaf4885f00bf Mon Sep 17 00:00:00 2001 From: Jakub Sztandera Date: Wed, 27 Jul 2016 16:48:16 +0100 Subject: [PATCH 1/6] make: run sharness in single thread License: MIT Signed-off-by: Jakub Sztandera --- Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 9469c24421e..5b702072aed 100644 --- a/Makefile +++ b/Makefile @@ -97,10 +97,10 @@ test_go_race: $(go_test) ./... -race test_sharness_short: - make -C test/sharness/ + make -j1 -C test/sharness/ test_sharness_expensive: - TEST_EXPENSIVE=1 make -C test/sharness/ + TEST_EXPENSIVE=1 make -j1 -C test/sharness/ test_all_commits: @echo "testing all commits between origin/master..HEAD" From 63072758a98eca242a925db9d95f5df970ebf706 Mon Sep 17 00:00:00 2001 From: Jakub Sztandera Date: Wed, 27 Jul 2016 15:35:49 +0100 Subject: [PATCH 2/6] make: use 'make -C' instead of 'cd && make' License: MIT Signed-off-by: Jakub Sztandera --- test/Makefile | 16 ++++++++-------- test/sharness/Makefile | 2 +- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/test/Makefile b/test/Makefile index 1408d0c4921..ecca6c71f0e 100644 --- a/test/Makefile +++ b/test/Makefile @@ -71,18 +71,18 @@ bin/iptb: iptb_src $(call find_go_files, $(IPTB_SRC)) IPFS-BUILD-OPTIONS test: test_expensive test_expensive: verify_gofmt - cd sharness && make TEST_EXPENSIVE=1 - cd 3nodetest && make - cd dependencies && make + make -C sharness TEST_EXPENSIVE=1 + make -C 3nodetest + make -C dependencies test_cheap: verify_gofmt - cd sharness && make - cd 3nodetest && make + make -C sharness + make -C 3nodetest test_race: verify_gofmt - cd sharness && make GOFLAGS=-race TEST_EXPENSIVE=1 - cd 3nodetest && make GOFLAGS=-race - cd dependencies && make GOFLAGS=-race + make -C sharness GOFLAGS=-race TEST_EXPENSIVE=1 + make -C 3nodetest GOFLAGS=-race + make -C dependencies GOFLAGS=-race # Misc diff --git a/test/sharness/Makefile b/test/sharness/Makefile index 4e6d2a940f8..97c55cb8846 100644 --- a/test/sharness/Makefile +++ b/test/sharness/Makefile @@ -43,7 +43,7 @@ $(SHARNESS): FORCE lib/install-sharness.sh bin/%: FORCE - cd .. && make GOFLAGS=$(GOFLAGS) $@ + make -C .. GOFLAGS=$(GOFLAGS) $@ race: make GOFLAGS=-race all From f3dc11c56604079a1fe73c8cd951e89d3e28ef69 Mon Sep 17 00:00:00 2001 From: Jakub Sztandera Date: Wed, 27 Jul 2016 15:38:09 +0100 Subject: [PATCH 3/6] use $(MAKE) instead of 'make' in Makefiles License: MIT Signed-off-by: Jakub Sztandera --- Makefile | 18 +++++++++--------- test/Makefile | 18 +++++++++--------- test/sharness/Makefile | 6 +++--- 3 files changed, 21 insertions(+), 21 deletions(-) diff --git a/Makefile b/Makefile index 5b702072aed..3be03c97b46 100644 --- a/Makefile +++ b/Makefile @@ -58,19 +58,19 @@ vendor: godep godep save -r ./... install: deps - make -C cmd/ipfs install + $(MAKE) -C cmd/ipfs install build: deps - make -C cmd/ipfs build + $(MAKE) -C cmd/ipfs build nofuse: deps - make -C cmd/ipfs nofuse + $(MAKE) -C cmd/ipfs nofuse clean: - make -C cmd/ipfs clean + $(MAKE) -C cmd/ipfs clean uninstall: - make -C cmd/ipfs uninstall + $(MAKE) -C cmd/ipfs uninstall PHONY += all help godep gx_check PHONY += go_check deps vendor install build nofuse clean uninstall @@ -97,16 +97,16 @@ test_go_race: $(go_test) ./... -race test_sharness_short: - make -j1 -C test/sharness/ + $(MAKE) -j1 -C test/sharness/ test_sharness_expensive: - TEST_EXPENSIVE=1 make -j1 -C test/sharness/ + TEST_EXPENSIVE=1 $(MAKE) -j1 -C test/sharness/ test_all_commits: @echo "testing all commits between origin/master..HEAD" @echo "WARNING: this will 'git rebase --exec'." @test/bin/continueyn - GIT_EDITOR=true git rebase -i --exec "make test" origin/master + GIT_EDITOR=true git rebase -i --exec "$(MAKE) test" origin/master test_all_commits_travis: # these are needed because travis. @@ -114,7 +114,7 @@ test_all_commits_travis: git config --global user.email "nemo@ipfs.io" git config --global user.name "IPFS BOT" git fetch origin master:master - GIT_EDITOR=true git rebase -i --exec "make test" master + GIT_EDITOR=true git rebase -i --exec "$(MAKE) test" master # since we have CI for osx and linux but not windows, this should help windows_build_check: diff --git a/test/Makefile b/test/Makefile index ecca6c71f0e..7b400db364a 100644 --- a/test/Makefile +++ b/test/Makefile @@ -15,7 +15,7 @@ GOFLAGS = all: deps global-deps: - make -C .. deps + $(MAKE) -C .. deps deps: global-deps bins @@ -71,18 +71,18 @@ bin/iptb: iptb_src $(call find_go_files, $(IPTB_SRC)) IPFS-BUILD-OPTIONS test: test_expensive test_expensive: verify_gofmt - make -C sharness TEST_EXPENSIVE=1 - make -C 3nodetest - make -C dependencies + $(MAKE) -C sharness TEST_EXPENSIVE=1 + $(MAKE) -C 3nodetest + $(MAKE) -C dependencies test_cheap: verify_gofmt - make -C sharness - make -C 3nodetest + $(MAKE) -C sharness + $(MAKE) -C 3nodetest test_race: verify_gofmt - make -C sharness GOFLAGS=-race TEST_EXPENSIVE=1 - make -C 3nodetest GOFLAGS=-race - make -C dependencies GOFLAGS=-race + $(MAKE) -C sharness GOFLAGS=-race TEST_EXPENSIVE=1 + $(MAKE) -C 3nodetest GOFLAGS=-race + $(MAKE) -C dependencies GOFLAGS=-race # Misc diff --git a/test/sharness/Makefile b/test/sharness/Makefile index 97c55cb8846..d43cccf3512 100644 --- a/test/sharness/Makefile +++ b/test/sharness/Makefile @@ -34,7 +34,7 @@ aggregate: clean-test-results $(T) lib/test-aggregate-results.sh global-deps: - make -C ../.. deps + $(MAKE) -C ../.. deps deps: global-deps $(SHARNESS) $(BINS) curl @@ -43,10 +43,10 @@ $(SHARNESS): FORCE lib/install-sharness.sh bin/%: FORCE - make -C .. GOFLAGS=$(GOFLAGS) $@ + $(MAKE) -C .. GOFLAGS=$(GOFLAGS) $@ race: - make GOFLAGS=-race all + $(MAKE) GOFLAGS=-race all .PHONY: all clean $(T) aggregate FORCE From c1014aea88d59bb76c904e18cbdd969d430c8998 Mon Sep 17 00:00:00 2001 From: Jakub Sztandera Date: Wed, 27 Jul 2016 16:26:18 +0100 Subject: [PATCH 4/6] make: 'make clean' clears sharness too License: MIT Signed-off-by: Jakub Sztandera --- Makefile | 1 + test/Makefile | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 3be03c97b46..e9a9eb28a74 100644 --- a/Makefile +++ b/Makefile @@ -68,6 +68,7 @@ nofuse: deps clean: $(MAKE) -C cmd/ipfs clean + $(MAKE) -C test clean uninstall: $(MAKE) -C cmd/ipfs uninstall diff --git a/test/Makefile b/test/Makefile index 7b400db364a..55b96d1430d 100644 --- a/test/Makefile +++ b/test/Makefile @@ -20,7 +20,8 @@ global-deps: deps: global-deps bins clean: - rm $(BINS) + $(MAKE) -C sharness clean + -rm -rf $(BINS) bins: $(BINS) From f93ce30018f620c833c2c65727943f772ee1bb77 Mon Sep 17 00:00:00 2001 From: Jakub Sztandera Date: Thu, 28 Jul 2016 14:16:47 +0100 Subject: [PATCH 5/6] make: squash install, build and nofuse rules License: MIT Signed-off-by: Jakub Sztandera --- Makefile | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/Makefile b/Makefile index e9a9eb28a74..eeeca750b51 100644 --- a/Makefile +++ b/Makefile @@ -57,14 +57,8 @@ deps: go_check gx_check path_check vendor: godep godep save -r ./... -install: deps - $(MAKE) -C cmd/ipfs install - -build: deps - $(MAKE) -C cmd/ipfs build - -nofuse: deps - $(MAKE) -C cmd/ipfs nofuse +install build nofuse: deps + $(MAKE) -C cmd/ipfs $@ clean: $(MAKE) -C cmd/ipfs clean From cc60f6909b1251811914404c8f7399a435f831e8 Mon Sep 17 00:00:00 2001 From: Jakub Sztandera Date: Thu, 28 Jul 2016 14:22:46 +0100 Subject: [PATCH 6/6] make: cleanup -rm calls License: MIT Signed-off-by: Jakub Sztandera --- Makefile | 2 +- test/Makefile | 2 +- test/sharness/Makefile | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index eeeca750b51..fa9ca8d5eea 100644 --- a/Makefile +++ b/Makefile @@ -114,7 +114,7 @@ test_all_commits_travis: # since we have CI for osx and linux but not windows, this should help windows_build_check: GOOS=windows GOARCH=amd64 go build -o .test.ipfs.exe ./cmd/ipfs - rm .test.ipfs.exe + rm -f .test.ipfs.exe PHONY += test test_short test_expensive diff --git a/test/Makefile b/test/Makefile index 55b96d1430d..9ebee7afbdc 100644 --- a/test/Makefile +++ b/test/Makefile @@ -21,7 +21,7 @@ deps: global-deps bins clean: $(MAKE) -C sharness clean - -rm -rf $(BINS) + rm -rf $(BINS) bins: $(BINS) diff --git a/test/sharness/Makefile b/test/sharness/Makefile index d43cccf3512..7a691c6d421 100644 --- a/test/sharness/Makefile +++ b/test/sharness/Makefile @@ -19,11 +19,11 @@ all: aggregate clean: clean-test-results @echo "*** $@ ***" - -rm -rf $(BINS) + rm -rf $(BINS) clean-test-results: @echo "*** $@ ***" - -rm -rf test-results + rm -rf test-results $(T): clean-test-results deps @echo "*** $@ ***"