-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
22 lines (16 loc) · 921 Bytes
/
Makefile
File metadata and controls
22 lines (16 loc) · 921 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
VERSION=$(shell git describe --tags --abbrev=0)
COMMIT=$(shell git rev-list -1 HEAD)
build:
go build -o bin/main main.go
run:
go run main.go
test:
go test -v ./... -covermode=count -coverprofile=coverage.out -coverpkg ./...
lint:
golangci-lint run --config=.github/linters/golangci.yml
clean:
rm -r bin/**
compile:
GOOS=darwin GOARCH=amd64 go build -ldflags="-X 'github.com/mdreem/json2line/cmd.Version=$(VERSION)' -X 'github.com/mdreem/json2line/cmd.GitCommit=$(COMMIT)'" -o bin/darwin-amd64/json2line main.go
GOOS=linux GOARCH=amd64 go build -ldflags="-X 'github.com/mdreem/json2line/cmd.Version=$(VERSION)' -X 'github.com/mdreem/json2line/cmd.GitCommit=$(COMMIT)'" -o bin/linux-amd64/json2line main.go
GOOS=windows GOARCH=amd64 go build -ldflags="-X 'github.com/mdreem/json2line/cmd.Version=$(VERSION)' -X 'github.com/mdreem/json2line/cmd.GitCommit=$(COMMIT)'" -o bin/windows-amd64/json2line.exe main.go