-
Notifications
You must be signed in to change notification settings - Fork 24
Expand file tree
/
Copy pathMakefile
More file actions
28 lines (23 loc) · 849 Bytes
/
Makefile
File metadata and controls
28 lines (23 loc) · 849 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
.ONESHELL:
.SHELLFLAGS := -e -c
VERSION := $(shell rpmspec rhc.spec --query --queryformat '%{version}')
# The 'build' target is not used during packaging; it is present for upstream development purposes.
.PHONY: build
build:
go build -ldflags "-X main.Version=$(VERSION)" -o rhc ./cmd/rhc
go build -ldflags "-X main.Version=${VERSION}" -o rhc-server ./cmd/rhc-server
go build -ldflags "-X main.Version=${VERSION}" -o rhc-collector ./cmd/rhc-collector
.PHONY: archive
archive:
git archive --prefix rhc-$(VERSION)/ --format tar.gz HEAD > rhc-$(VERSION).tar.gz
go_vendor_archive create --output rhc-$(VERSION)-vendor.tar.bz2 .
.PHONY: srpm
srpm: archive
rpmbuild --define "_sourcedir $$(pwd)" -bs rhc.spec
# The 'clean' target removes build artifacts.
.PHONY: clean
clean:
rm -f rhc
rm -f rhc-server
rm -f rhc-collector
rm -f rhc-*.tar*