From f27c66c1f18522a75ddad61913176da3b24ed08c Mon Sep 17 00:00:00 2001 From: Shulhan Date: Thu, 7 Mar 2019 02:38:12 +0700 Subject: all: add Makefile to rebuild go and other tools from source --- .gitignore | 2 ++ Makefile | 53 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 55 insertions(+) create mode 100644 Makefile diff --git a/.gitignore b/.gitignore index 7978d68b76..8d8bff481f 100644 --- a/.gitignore +++ b/.gitignore @@ -24,10 +24,12 @@ _testmain.go /build.out /doc/articles/wiki/*.bin /goinstall.log +/issues/ /last-change /misc/cgo/life/run.out /misc/cgo/stdio/run.out /misc/cgo/testso/main +/nonexistentpath/ /pkg/ /src/*.*/ /src/cmd/cgo/zdefaultcc.go diff --git a/Makefile b/Makefile new file mode 100644 index 0000000000..fd48b62a52 --- /dev/null +++ b/Makefile @@ -0,0 +1,53 @@ +.PHONY: all go tools golangci-lint revive x-codereview x-perf x-tools +.PHONY: cmd sync test + +export GOFLAGS=-vet=off + +all: test tools + +## Use it only for bisecting. +cmd: + cd src && time ./make.bash + +sync: + git remote prune upstream + git remote prune origin + git fetch --prune --all --tags --force + git rebase upstream/master master + +test: + cd src && time ./all.bash + +## Rebuild third parties tools. + +tools: golangci-lint revive x-codereview x-perf x-tools + +revive: + @echo "" + @echo ">>> Rebuilding github.com/mgechev/revive" + cd ~/go/src/github.com/mgechev/revive \ + && git pull --tags --prune --rebase \ + && go install . + +x-codereview: + @echo "" + @echo ">>> Rebuilding golang.org/x/review" + cd ~/go/src/golang.org/x/review/git-codereview \ + && git pull --tags --prune --rebase \ + && go install . + +x-perf: + @echo "" + @echo ">>> Rebuilding golang.org/x/perf" + cd ~/go/src/golang.org/x/perf \ + && git pull --tags --prune --rebase \ + && go install ./cmd/... + +x-tools: + @echo "" + @echo ">>> Rebuilding golang.org/x/tools" + cd ~/go/src/golang.org/x/tools \ + && git pull --tags --prune --rebase \ + && go install ./cmd/... \ + && go install ./go/analysis/passes/fieldalignment/cmd/fieldalignment/ \ + && go install ./go/analysis/passes/shadow/cmd/shadow/ -- cgit v1.3