-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathMakefile
More file actions
38 lines (26 loc) · 985 Bytes
/
Makefile
File metadata and controls
38 lines (26 loc) · 985 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
VERSION := $(shell head -n 1 debian/changelog | awk '{match( $$0, /\(.+?\)/); print substr( $$0, RSTART+1, RLENGTH-2 ) }' | cut -d- -f1 )
GIT_VERSION = $(shell git rev-list -1 HEAD)
all: contractorcli
install: contractorcli
mkdir -p $(DESTDIR)/usr/bin
install -m 755 contractorcli $(DESTDIR)/usr/bin
version:
echo $(VERSION)
contractorcli: main.go cmd/* go.mod go.sum debian/changelog
go build -ldflags "-linkmode external -extldflags -static -X 'github.com/t3kton/contractorcli/cmd.version=${VERSION}' -X 'github.com/t3kton/contractorcli/cmd.gitVersion=${GIT_VERSION}'" -o contractorcli -a main.go
clean:
$(RM) contractorcli
$(RM) dpkg
dh_clean || true
dist-clean: clean
.PHONY:: version clean dist-clean
dpkg-blueprints:
echo ubuntu-focal-base
dpkg-requires:
echo dpkg-dev debhelper golang-1.13 golang
dpkg:
dpkg-buildpackage -b -us -uc
touch dpkg
dpkg-file:
echo $(shell ls ../contractorcli_*.deb):focal
.PHONY:: dpkg-blueprints dpkg-requires dpkg dpkg-file