-
Notifications
You must be signed in to change notification settings - Fork 4
/
Makefile
49 lines (36 loc) · 1.31 KB
/
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
45
46
47
48
49
GO ?= go
GO_MD2MAN ?= go-md2man
VERSION := HEAD
USE_VENDOR =
LOCAL_LDFLAGS = -buildmode=pie -ldflags "-X main.rpm2docservVersion=$(VERSION)"
.PHONY: all api build vendor
all: dep bundle build
dep: ## Get the dependencies
@$(GO) get -v -d ./...
update: ## Get and update the dependencies
@$(GO) get -v -d -u ./...
tidy: ## Clean up dependencies
@$(GO) mod tidy
vendor: dep ## Create vendor directory
@$(GO) mod vendor
api: ## Auto-generate grpc go sources
@protoc -I pkg/proto/ \
--go_out=pkg/proto \
pkg/proto/index.proto
bundle: ## Generate embedded files
$(GO) generate bundle.go
build: ## Build the binary files
$(GO) build -v -o bin/ $(USE_VENDOR) $(LOCAL_LDFLAGS) ./cmd/...
clean: ## Remove previous builds
@rm -f bin/*
help: ## Display this help screen
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
.PHONY: release
release: ## create release package from git
git clone https://github.com/thkukuk/rpm2docserv
mv rpm2docserv rpm2docserv-$(VERSION)
sed -i -e 's|USE_VENDOR =|USE_VENDOR = -mod vendor|g' rpm2docserv-$(VERSION)/Makefile
make -C rpm2docserv-$(VERSION) vendor
#cp VERSION rpm2docserv-$(VERSION)
tar --exclude .git -cJf rpm2docserv-$(VERSION).tar.xz rpm2docserv-$(VERSION)
rm -rf rpm2docserv-$(VERSION)