aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShulhan <m.shulhan@gmail.com>2019-03-07 02:38:12 +0700
committerShulhan <m.shulhan@gmail.com>2024-01-25 04:01:14 +0700
commitf27c66c1f18522a75ddad61913176da3b24ed08c (patch)
tree52a430a2798409e6b69e7ca28ebbd7a2ee70f8e4
parent5000b5168037d26a796da46a07088e834c3af1a0 (diff)
downloadgo-f27c66c1f18522a75ddad61913176da3b24ed08c.tar.xz
all: add Makefile to rebuild go and other tools from source
-rw-r--r--.gitignore2
-rw-r--r--Makefile53
2 files changed, 55 insertions, 0 deletions
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/