-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
33 lines (24 loc) · 843 Bytes
/
Copy pathMakefile
File metadata and controls
33 lines (24 loc) · 843 Bytes
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
BIN ?= bin/diffah
PKG := github.com/leosocy/diffah
VERSION ?= $(shell git describe --tags --always --dirty 2>/dev/null || echo dev)
LDFLAGS := -X $(PKG)/cmd.version=$(VERSION)
GOFLAGS := -trimpath
TAGS := containers_image_openpgp exclude_graphdriver_btrfs exclude_graphdriver_devicemapper
.PHONY: build test test-integration lint fmt fixtures snapshot clean
build:
CGO_ENABLED=0 go build $(GOFLAGS) -tags '$(TAGS)' -ldflags '$(LDFLAGS)' -o $(BIN) .
test:
go test $(GOFLAGS) -tags '$(TAGS)' -race -cover ./...
test-integration:
go test $(GOFLAGS) -tags 'integration $(TAGS)' -race -cover ./...
lint:
golangci-lint run ./...
fmt:
gofmt -s -w .
goimports -w -local $(PKG) .
fixtures:
go run -tags '$(TAGS)' ./scripts/build_fixtures
snapshot:
goreleaser release --snapshot --clean
clean:
rm -rf bin/ dist/