-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathMakefile
More file actions
46 lines (36 loc) · 925 Bytes
/
Makefile
File metadata and controls
46 lines (36 loc) · 925 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
34
35
36
37
38
39
40
41
42
43
44
45
46
SHELL := /bin/bash
TARGETS = solrbulk
PKGNAME = solrbulk
VERSION = 0.4.9
SEMVER := $(shell echo $(VERSION) | sed 's/^v//')
.PHONY: all
all: imports test
$(MAKE) $(TARGETS)
.PHONY: test
test:
go test -v ./...
.PHONY: imports
imports:
goimports -w .
docs/solrbulk.1: docs/solrbulk.md
md2man-roff docs/solrbulk.md > docs/solrbulk.1
.PHONY: clean
clean:
go clean
rm -f coverage.out
rm -f $(TARGETS)
rm -f $(PKGNAME)_*.deb
rm -f $(PKGNAME)-*.rpm
.PHONY: cover
cover:
go get -d && go test -v -coverprofile=coverage.out
go tool cover -html=coverage.out
solrbulk: cmd/solrbulk/solrbulk.go
go build -ldflags "-s -w -X github.com/miku/solrbulk.Version=$(VERSION)" -o $@ $<
# nfpm-based packaging.
.PHONY: deb
deb: $(TARGETS) docs/solrbulk.1
SEMVER=$(SEMVER) GOARCH=amd64 nfpm package -p deb -f nfpm.yaml
.PHONY: rpm
rpm: $(TARGETS) docs/solrbulk.1
SEMVER=$(SEMVER) GOARCH=amd64 nfpm package -p rpm -f nfpm.yaml