mirror of
https://github.com/Jguer/yay.git
synced 2024-11-07 09:37:22 +01:00
26 lines
491 B
Makefile
26 lines
491 B
Makefile
|
export GO111MODULE=on
|
||
|
|
||
|
GOFLAGS := -v -mod=vendor
|
||
|
EXTRA_GOFLAGS ?=
|
||
|
LDFLAGS := $(LDFLAGS)
|
||
|
GO ?= go
|
||
|
|
||
|
SOURCES ?= $(shell find . -name "*.go" -type f ! -path "./vendor/*")
|
||
|
|
||
|
.PHONY: default
|
||
|
default: build
|
||
|
|
||
|
.PHONY: build
|
||
|
build:
|
||
|
$(GO) build $(GOFLAGS) -ldflags '-s -w $(LDFLAGS)' $(EXTRA_GOFLAGS)
|
||
|
|
||
|
.PHONY: test
|
||
|
test:
|
||
|
$(GO) vet $(GOFLAGS) .
|
||
|
@test -z "$$(gofmt -l *.go)" || (echo "Files need to be linted. Use make fmt" && false)
|
||
|
$(GO) test $(GOFLAGS) .
|
||
|
|
||
|
.PHONY: fmt
|
||
|
fmt:
|
||
|
gofmt -s -w $(SOURCES)
|