aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile79
1 files changed, 79 insertions, 0 deletions
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