aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShulhan <m.shulhan@gmail.com>2019-03-07 02:38:12 +0700
committerShulhan <m.shulhan@gmail.com>2026-04-14 21:51:40 +0700
commit067acdfefa3f9702ca1af5f5c2b18304afa59614 (patch)
tree11af3d6a4bda3e3f424f7ea10d0ce875760d918e
parentf0eca1afc2477dfcf0f17078e902e59956af63c2 (diff)
downloadgo-067acdfefa3f9702ca1af5f5c2b18304afa59614.tar.xz
[DO-NOT-MERGE] all: add Makefile for common tasks
Change-Id: I2dffb77970d653cdc884bde4c2625293c53a913c
-rw-r--r--.gitignore2
-rw-r--r--Makefile79
2 files changed, 81 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore
index 344b31f7ac..1d6273511d 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/_artifacts/
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000000..1fddb3cfb0
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,79 @@
+LATEST_TAG=go1.27.0
+COUNT_COMMITS=$(shell git rev-list --count ${LATEST_TAG}..HEAD)
+HEAD=$(shell git rev-parse --short HEAD)
+TAG_VERSION=$(shell echo ${LATEST_TAG} | sed 's/^go//;s/-/./g')
+VERSION="${TAG_VERSION}.r${COUNT_COMMITS}.g${HEAD}"
+
+.PHONY: all
+all: test tools fake
+
+## Use it only for bisecting.
+.PHONY: cmd
+cmd: GOFLAGS=-vet=off
+cmd:
+ cd src && time ./make.bash
+
+.PHONY: sync
+sync:
+ git remote prune upstream
+ git remote prune origin
+ git fetch --prune --all --tags --force
+ git rebase upstream/master master
+
+.PHONY: test
+test: GOFLAGS=-vet=off
+test:
+ cd src && time ./all.bash
+
+.PHONY: fake
+fake:
+ echo $(VERSION)
+ makefake --name=go --version=$(VERSION) --epoch=2 go
+
+## Rebuild third parties tools.
+
+.PHONY: tools
+tools: x-codereview x-perf x-tools x-website
+
+.PHONY: x-codereview
+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 .
+
+.PHONY: x-perf
+x-perf:
+ @echo ""
+ @echo ">>> Rebuilding golang.org/x/perf"
+ cd ~/go/src/golang.org/x/perf \
+ && git pull --tags --prune --rebase \
+ && go install ./cmd/...
+
+.PHONY: x-pkgsite
+x-pkgsite:
+ @echo ""
+ @echo ">>> Rebuilding golang.org/x/pkgsite"
+ cd ~/go/src/golang.org/x/pkgsite \
+ && git pull --tags --prune --rebase \
+ && go install ./cmd/...
+
+.PHONY: x-tools
+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/
+
+.PHONY: x-website
+x-website:
+ @echo ""
+ @echo ">>> Rebuilding golang.org/x/website"
+ cd ~/go/src/golang.org/x/website \
+ && git fetch --all --tags --prune \
+ && git rebase upstream/master \
+ && go install ./cmd/golangorg