|
8 | 8 | # the images actually do download the stage0 binary on start-up.
|
9 | 9 | #
|
10 | 10 |
|
| 11 | +GO=go1.19 |
| 12 | + |
| 13 | +ALL=\ |
| 14 | + buildlet-stage0.illumos-amd64 \ |
| 15 | + buildlet-stage0.linux-arm \ |
| 16 | + buildlet-stage0.linux-arm64 \ |
| 17 | + buildlet-stage0.linux-loong64 \ |
| 18 | + buildlet-stage0.linux-mips \ |
| 19 | + buildlet-stage0.linux-mips64 \ |
| 20 | + buildlet-stage0.linux-mips64le \ |
| 21 | + buildlet-stage0.linux-mipsle \ |
| 22 | + buildlet-stage0.linux-ppc64 \ |
| 23 | + buildlet-stage0.linux-ppc64le \ |
| 24 | + buildlet-stage0.linux-s390x \ |
| 25 | + buildlet-stage0.solaris-amd64 \ |
| 26 | + buildlet-stage0.windows-amd64 \ |
| 27 | + buildlet-stage0.windows-arm64 \ |
| 28 | + |
11 | 29 | usage: FORCE
|
12 |
| - # See targets in Makefile |
| 30 | + @sed -E '/^$$/q; s/^# ?//' Makefile |
13 | 31 | exit 1
|
14 | 32 |
|
15 | 33 | FORCE:
|
16 | 34 |
|
17 |
| -docker: Dockerfile |
18 |
| - go install golang.org/x/build/cmd/xb |
19 |
| - xb docker build --force-rm -f Dockerfile --tag=golang/buildlet-stage0 ../../.. |
| 35 | +# A convenience for people who are missing $(GO). |
| 36 | +install-go: |
| 37 | + go install golang.org/dl/$(GO)@latest |
| 38 | + $(GO) download |
| 39 | + |
| 40 | +clean: |
| 41 | + rm -f buildlet-stage0.*-* |
| 42 | + |
| 43 | +# Compile everything without uploading. |
| 44 | +compile: $(ALL) |
20 | 45 |
|
21 |
| -buildlet-stage0.windows-amd64: FORCE |
22 |
| - go install golang.org/x/build/cmd/upload |
23 |
| - upload --verbose --osarch=$@ --file=go:golang.org/x/build/cmd/buildlet/stage0 --public --cacheable=false go-builder-data/$@ |
| 46 | +GOFILES:=$(shell ls *.go) |
24 | 47 |
|
25 |
| -buildlet-stage0.windows-arm64: FORCE |
26 |
| - go install golang.org/x/build/cmd/upload |
27 |
| - upload --verbose --osarch=$@ --file=go:golang.org/x/build/cmd/buildlet/stage0 --public --cacheable=false go-builder-data/$@ |
| 48 | +BUILD=CGO_ENABLED=0 $(GO) build -o |
28 | 49 |
|
29 |
| -buildlet-stage0.linux-arm: FORCE |
30 |
| - go install golang.org/x/build/cmd/upload |
31 |
| - upload --verbose --osarch=$@ --file=go:golang.org/x/build/cmd/buildlet/stage0 --public --cacheable=false go-builder-data/$@ |
| 50 | +buildlet-stage0.%-arm: $(GOFILES) |
| 51 | + GOOS=$* GOARCH=arm GOARM=7 $(BUILD) $@ |
32 | 52 |
|
33 |
| -buildlet-stage0.linux-arm64: FORCE |
34 |
| - go install golang.org/x/build/cmd/upload |
35 |
| - upload --verbose --osarch=$@ --file=go:golang.org/x/build/cmd/buildlet/stage0 --public --cacheable=false go-builder-data/$@ |
| 53 | +buildlet-stage0.%-arm64: $(GOFILES) |
| 54 | + GOOS=$* GOARCH=arm64 $(BUILD) $@ |
36 | 55 |
|
37 |
| -buildlet-stage0.linux-ppc64: FORCE |
38 |
| - go install golang.org/x/build/cmd/upload |
39 |
| - upload --verbose --osarch=$@ --file=go:golang.org/x/build/cmd/buildlet/stage0 --public --cacheable=false go-builder-data/$@ |
| 56 | +buildlet-stage0.%-amd64: $(GOFILES) |
| 57 | + GOOS=$* GOARCH=amd64 $(BUILD) $@ |
40 | 58 |
|
41 |
| -buildlet-stage0.linux-ppc64le: FORCE |
42 |
| - go install golang.org/x/build/cmd/upload |
43 |
| - upload --verbose --osarch=$@ --file=go:golang.org/x/build/cmd/buildlet/stage0 --public --cacheable=false go-builder-data/$@ |
| 59 | +buildlet-stage0.%-loong64: $(GOFILES) |
| 60 | + GOOS=$* GOARCH=loong64 $(BUILD) $@ |
44 | 61 |
|
45 |
| -buildlet-stage0.solaris-amd64: FORCE |
46 |
| - go install golang.org/x/build/cmd/upload |
47 |
| - upload --verbose --osarch=$@ --file=go:golang.org/x/build/cmd/buildlet/stage0 --public --cacheable=false go-builder-data/$@ |
| 62 | +buildlet-stage0.%-mips: $(GOFILES) |
| 63 | + GOOS=$* GOARCH=mips $(BUILD) $@ |
48 | 64 |
|
49 |
| -buildlet-stage0.illumos-amd64: FORCE |
50 |
| - go install golang.org/x/build/cmd/upload |
51 |
| - upload --verbose --osarch=$@ --file=go:golang.org/x/build/cmd/buildlet/stage0 --public --cacheable=false go-builder-data/$@ |
| 65 | +buildlet-stage0.%-mipsle: $(GOFILES) |
| 66 | + GOOS=$* GOARCH=mipsle $(BUILD) $@ |
52 | 67 |
|
53 |
| -buildlet-stage0.linux-s390x: FORCE |
54 |
| - go install golang.org/x/build/cmd/upload |
55 |
| - upload --verbose --osarch=$@ --file=go:golang.org/x/build/cmd/buildlet/stage0 --public --cacheable=false go-builder-data/$@ |
| 68 | +buildlet-stage0.%-mips64: $(GOFILES) |
| 69 | + GOOS=$* GOARCH=mips64 $(BUILD) $@ |
56 | 70 |
|
57 |
| -buildlet-stage0.linux-mipsle: FORCE |
58 |
| - go install golang.org/x/build/cmd/upload |
59 |
| - upload --verbose --osarch=$@ --file=go:golang.org/x/build/cmd/buildlet/stage0 --public --cacheable=false go-builder-data/$@ |
| 71 | +buildlet-stage0.%-mips64le: $(GOFILES) |
| 72 | + GOOS=$* GOARCH=mips64le $(BUILD) $@ |
60 | 73 |
|
61 |
| -buildlet-stage0.linux-mips64le: FORCE |
62 |
| - go install golang.org/x/build/cmd/upload |
63 |
| - upload --verbose --osarch=$@ --file=go:golang.org/x/build/cmd/buildlet/stage0 --public --cacheable=false go-builder-data/$@ |
| 74 | +buildlet-stage0.%-ppc64: $(GOFILES) |
| 75 | + GOOS=$* GOARCH=ppc64 $(BUILD) $@ |
| 76 | + |
| 77 | +buildlet-stage0.%-ppc64le: $(GOFILES) |
| 78 | + GOOS=$* GOARCH=ppc64le $(BUILD) $@ |
| 79 | + |
| 80 | +buildlet-stage0.%-s390x: $(GOFILES) |
| 81 | + GOOS=$* GOARCH=s390x $(BUILD) $@ |
| 82 | + |
| 83 | +docker: Dockerfile |
| 84 | + go install golang.org/x/build/cmd/xb |
| 85 | + xb docker build --force-rm -f Dockerfile --tag=golang/buildlet-stage0 ../../.. |
64 | 86 |
|
65 |
| -buildlet-stage0.linux-mips: FORCE |
66 |
| - go install golang.org/x/build/cmd/upload |
67 |
| - upload --verbose --osarch=$@ --file=go:golang.org/x/build/cmd/buildlet/stage0 --public --cacheable=false go-builder-data/$@ |
| 87 | +# Upload everything. |
| 88 | +upload: $(ALL:buildlet-stage0.%=upload.%) |
68 | 89 |
|
69 |
| -buildlet-stage0.linux-mips64: FORCE |
70 |
| - go install golang.org/x/build/cmd/upload |
71 |
| - upload --verbose --osarch=$@ --file=go:golang.org/x/build/cmd/buildlet/stage0 --public --cacheable=false go-builder-data/$@ |
| 90 | +UPLOAD=$(GO) run golang.org/x/build/cmd/upload -verbose -public -cacheable=false |
72 | 91 |
|
73 |
| -buildlet-stage0.linux-loong64: FORCE |
74 |
| - go install golang.org/x/build/cmd/upload |
75 |
| - upload --verbose --osarch=$@ --file=go:golang.org/x/build/cmd/buildlet/stage0 --public --cacheable=false go-builder-data/$@ |
| 92 | +upload.%: buildlet-stage0.% |
| 93 | + $(UPLOAD) -file=$< go-builder-data/$< |
76 | 94 |
|
77 |
| -# macstadium uploads all the darwin-amd64 stage0 binary as |
78 |
| -# different filenames, which is used by different Mac VM images. |
79 |
| -# See the env/darwin/macstadium/** files for details. |
80 |
| -macstadium: run-builder-darwin-10_11.gz |
| 95 | +# Upload everything to dev cluster. |
| 96 | +dev-upload: $(ALL:buildlet-stage0.%=upload.%) |
81 | 97 |
|
82 |
| -# run-builder-darwin-10_11.gz is used by both our macOS 10.11 and 10.12 VM images. |
83 |
| -run-builder-darwin-10_11.gz: FORCE |
84 |
| - go install golang.org/x/build/cmd/upload |
85 |
| - upload --verbose --osarch=darwin-amd64 --file=go:golang.org/x/build/cmd/buildlet/stage0 --public --cacheable=false --gzip go-builder-data/$@ |
| 98 | +dev-upload.%: buildlet-stage0.% |
| 99 | + $(UPLOAD) -file=$< dev-go-builder-data/$< |
0 commit comments