-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathMakefile
44 lines (33 loc) · 835 Bytes
/
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
# Makefile for urusai
.PHONY: build run test lint clean all
all: lint test build
build:
go build -o urusai
run: build
./urusai
run-config: build
./urusai --config config.json
run-debug: build
./urusai --log debug
test:
go test -v ./...
test-coverage:
go test -coverprofile=coverage.out ./...
go tool cover -html=coverage.out
lint:
go fmt ./...
go vet ./...
@if command -v golangci-lint > /dev/null; then
golangci-lint run
else
echo "golangci-lint not installed, skipping lint"
fi
clean:
rm -f urusai coverage.out
# Build for multiple platforms
.PHONY: build-all
build-all:
GOOS=darwin GOARCH=amd64 go build -o urusai-macos-amd64
GOOS=darwin GOARCH=arm64 go build -o urusai-macos-arm64
GOOS=linux GOARCH=amd64 go build -o urusai-linux-amd64
GOOS=windows GOARCH=amd64 go build -o urusai-windows-amd64.exe