-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
39 lines (29 loc) · 1.05 KB
/
Makefile
File metadata and controls
39 lines (29 loc) · 1.05 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
31
32
33
34
35
36
37
38
39
BINARY := devbox
MODULE := github.com/junixlabs/devbox
BUILD_DIR := dist
VERSION ?= $(shell git describe --tags 2>/dev/null || echo "0.1.0-dev")
LDFLAGS := -s -w -X main.version=$(VERSION)
PLATFORMS := linux/amd64 linux/arm64 darwin/amd64 darwin/arm64
.PHONY: build release clean test test-unit test-integration test-all vet
build:
@mkdir -p $(BUILD_DIR)
go build -ldflags '$(LDFLAGS)' -o $(BUILD_DIR)/$(BINARY) ./cmd/devbox/
release:
@mkdir -p $(BUILD_DIR)
@for platform in $(PLATFORMS); do \
GOOS=$${platform%/*} GOARCH=$${platform#*/} \
go build -ldflags '$(LDFLAGS)' -o $(BUILD_DIR)/$(BINARY)-$${platform%/*}-$${platform#*/} ./cmd/devbox/ && \
echo "Built $(BINARY)-$${platform%/*}-$${platform#*/}"; \
done
@cd $(BUILD_DIR) && sha256sum $(BINARY)-* > checksums.txt
@echo "Checksums written to $(BUILD_DIR)/checksums.txt"
clean:
rm -rf $(BUILD_DIR)
test:
go test -count=1 ./...
test-unit: test
test-integration:
go test -tags integration -v -timeout 300s -count=1 ./internal/integration/
test-all: test test-integration
vet:
go vet ./...