-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
124 lines (93 loc) · 3.33 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
bootstrap:
# Check CONTRIBUTING.md for the required dependencies
curl -fsSL https://get.jetpack.io/devbox | bash
curl -sfL https://direnv.net/install.sh | bash
GO_SRC := $(shell find pkg -type f -name '*.go')
structlayout: cmd/structlayout/structlayout.go $(filter-out *_test.go,$(GO_SRC))
go build -o $@ $<
mergelayout: cmd/mergelayout/mergelayout.go $(filter-out *_test.go,$(GO_SRC))
go build -o $@ $<
debdownload: cmd/debdownload/debdownload.go $(filter-out *_test.go,$(GO_SRC))
go build -o $@ $<
apkdownload: cmd/apkdownload/apkdownload.go $(filter-out *_test.go,$(GO_SRC))
go build -o $@ $<
debuginfofind: cmd/debuginfofind/debuginfofind.go $(filter-out *_test.go,$(GO_SRC))
go build -o $@ $<
.PHONY: build
build: structlayout mergelayout debdownload apkdownload debuginfofind
go build ./...
.PHONY: generate
generate: build generate/python generate/ruby generate/glibc generate/musl generate/openjdk
.PHONY: generate/python
generate/python:
./scripts/download/python.sh
./scripts/structlayout/python.sh
./scripts/mergelayout/python.sh
.PHONY: generate/ruby
generate/ruby:
./scripts/download/ruby.sh
./scripts/structlayout/ruby.sh
./scripts/mergelayout/ruby.sh
.PHONY: generate/glibc
generate/glibc:
./scripts/download/glibc.sh
./scripts/structlayout/glibc.sh
./scripts/mergelayout/glibc.sh
.PHONY: generate/musl
generate/musl:
./scripts/download/musl.sh
./scripts/structlayout/musl.sh
./scripts/mergelayout/musl.sh
.PHONY: generate/openjdk
generate/openjdk:
./scripts/download/openjdk.sh
./scripts/structlayout/openjdk.sh
./scripts/mergelayout/openjdk.sh
.PHONY: clean
clean:
rm -rf target
.PHONY: check
check: vet lint
.PHONY: vet
vet:
go vet ./...
.PHONY: lint
lint:
go run github.com/golangci/golangci-lint/cmd/golangci-lint@latest run
.PHONY: fix
fix:
go run github.com/golangci/golangci-lint/cmd/golangci-lint@latest run --fix
.PHONY: format
format:
go run mvdan.cc/gofumpt@latest -l -w .
.PHONY: tagalign
tagalign:
go run github.com/4meepo/tagalign/cmd/tagalign@latest -fix -sort ./...
.PHONY: test
test: build
go test ./...
.PHONY: test/integration
test/integration: build
@echo "Make sure to run 'generate' if any generation code has changed"
go test -tags=integration ./tests/integration/...
.PHONY: test/integration/update
test/integration/update:
go test -count=1 -race -tags=integration ./tests/integration/... -update
TMPDIR := ./tmp
$(TMPDIR):
mkdir -p $(TMPDIR)
$(TMPDIR)/structlayout-help.txt: $(TMPDIR) ./cmd/structlayout/structlayout.go
mkdir -p ./tmp
go run ./cmd/structlayout/structlayout.go -h > $@ 2>&1
$(TMPDIR)/mergelayout-help.txt: $(TMPDIR) ./cmd/mergelayout/mergelayout.go
go run ./cmd/mergelayout/mergelayout.go -h > $@ 2>&1
$(TMPDIR)/debdownload-help.txt: $(TMPDIR) ./cmd/debdownload/debdownload.go
go run ./cmd/debdownload/debdownload.go -h > $@ 2>&1
$(TMPDIR)/apkdownload-help.txt: $(TMPDIR) ./cmd/apkdownload/apkdownload.go
go run ./cmd/apkdownload/apkdownload.go -h > $@ 2>&1
$(TMPDIR)/debuginfofind-help.txt: $(TMPDIR) ./cmd/debuginfofind/debuginfofind.go
go run ./cmd/debuginfofind/debuginfofind.go -h > $@ 2>&1
.PHONY: README.md
README.md: $(TMPDIR)/structlayout-help.txt $(TMPDIR)/mergelayout-help.txt $(TMPDIR)/debdownload-help.txt $(TMPDIR)/debuginfofind-help.txt $(TMPDIR)/apkdownload-help.txt
go run github.com/campoy/embedmd/v2@latest -w README.md
devbox generate readme CONTRIBUTING.md