-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
27 lines (21 loc) · 1.04 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
VERSION := $(shell bash scripts/version.sh; cat VERSION)
.PHONY: version test bin release dev
test:
@echo "Running tests..."
@go test -cover ./pkg/...
version:
@bash scripts/version.sh
@echo "Version: $(shell cat VERSION)"
bin:
@mkdir -p bin
@GOOS=linux GOARCH=amd64 go build -o bin/atlas-$(VERSION)-linux-amd64 -ldflags "-X github.com/MohamedBeydoun/atlas/cmd.version=$(shell cat VERSION)"
@echo "Generated bin/atlas-$(VERSION)-linux-amd64"
@GOOS=windows GOARCH=amd64 go build -o bin/atlas-$(VERSION)-windows-amd64 -ldflags "-X github.com/MohamedBeydoun/atlas/cmd.version=$(shell cat VERSION)"
@echo "Generated bin/atlas-$(VERSION)-windows-amd64"
@GOOS=darwin GOARCH=amd64 go build -o bin/atlas-$(VERSION)-darwin-amd64 -ldflags "-X github.com/MohamedBeydoun/atlas/cmd.version=$(shell cat VERSION)"
@echo "Generated bin/atlas-$(VERSION)-darwin-amd64"
release: version
@bash scripts/release.sh $(shell cat VERSION)
@echo "Release complete!"
dev: version
@go install -ldflags "-X github.com/MohamedBeydoun/atlas/cmd.version=$(shell cat VERSION)"