-
Notifications
You must be signed in to change notification settings - Fork 45
Expand file tree
/
Copy pathMakefile
More file actions
30 lines (22 loc) · 1.63 KB
/
Copy pathMakefile
File metadata and controls
30 lines (22 loc) · 1.63 KB
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
SHELL=/bin/bash
GOTOOLCHAIN=go1.26.1
AUTOTESTS = gophermarttest metricstest devopstest shortenertest shortenertestbeta shortenertest_v2 metricstest_v2 devopsmastertest firstfloortest covertest
UTILS = random statictest shortenerstress wipedb
.PHONY: clear prep perm
all: prep autotests utils perm
clear:
rm -rf bin/*
prep:
GOTOOLCHAIN=$(GOTOOLCHAIN) go mod tidy
autotests:
$(foreach TARGET,$(AUTOTESTS),GOOS=linux GOARCH=amd64 GOTOOLCHAIN=$(GOTOOLCHAIN) go test -c -o=bin/$(TARGET)-linux-amd64 -o=bin/$(TARGET) ./cmd/$(TARGET)/... ;)
$(foreach TARGET,$(AUTOTESTS),GOOS=windows GOARCH=amd64 GOTOOLCHAIN=$(GOTOOLCHAIN) go test -c -o=bin/$(TARGET)-windows-amd64.exe ./cmd/$(TARGET)/... ;)
$(foreach TARGET,$(AUTOTESTS),GOOS=darwin GOARCH=amd64 GOTOOLCHAIN=$(GOTOOLCHAIN) go test -c -o=bin/$(TARGET)-darwin-amd64 ./cmd/$(TARGET)/... ;)
$(foreach TARGET,$(AUTOTESTS),GOOS=darwin GOARCH=arm64 GOTOOLCHAIN=$(GOTOOLCHAIN) go test -c -o=bin/$(TARGET)-darwin-arm64 ./cmd/$(TARGET)/... ;)
utils:
$(foreach TARGET,$(UTILS),GOOS=linux GOARCH=amd64 GOTOOLCHAIN=$(GOTOOLCHAIN) go build -buildvcs=false -o=bin/$(TARGET)-linux-amd64 -o=bin/$(TARGET) ./cmd/$(TARGET)/... ;)
$(foreach TARGET,$(UTILS),GOOS=windows GOARCH=amd64 GOTOOLCHAIN=$(GOTOOLCHAIN) go build -buildvcs=false -o=bin/$(TARGET)-windows-amd64.exe ./cmd/$(TARGET)/... ;)
$(foreach TARGET,$(UTILS),GOOS=darwin GOARCH=amd64 GOTOOLCHAIN=$(GOTOOLCHAIN) go build -buildvcs=false -o=bin/$(TARGET)-darwin-amd64 ./cmd/$(TARGET)/... ;)
$(foreach TARGET,$(UTILS),GOOS=darwin GOARCH=arm64 GOTOOLCHAIN=$(GOTOOLCHAIN) go build -buildvcs=false -o=bin/$(TARGET)-darwin-arm64 ./cmd/$(TARGET)/... ;)
perm:
chmod -R +x bin