forked from bechampion/gohip
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
46 lines (33 loc) · 1.26 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
all: delete_latest_tag recreate_tag push_tag
delete_latest_tag:
@echo "Deleting latest local tag: latest"
@git tag -d latest
recreate_tag:
@echo "Recreating tag: latest"
@git tag latest
push_tag:
@echo "Force pushing tag: latest"
@git push --force origin latest
.PHONY: all delete_latest_tag recreate_tag push_tag
test:
go test -v ./systemd ./others ./osdata ./types .
build: build-dynamic build-static
build-dynamic:
go build -o gohip-$(GOOS)-$(GOARCH)
build-static:
CGO_ENABLED=0 go build -o gohip-static-$(GOOS)-$(GOARCH)
install: build
mkdir -p $(DESTDIR)/usr/bin
cp gohip-$(GOOS)-$(GOARCH) $(DESTDIR)/usr/bin/gohip
cp gohip-static-$(GOOS)-$(GOARCH) $(DESTDIR)/usr/bin/gohip-static
debian-pkg: install
mkdir -p $(DESTDIR)/DEBIAN
mkdir -p $(DESTDIR)/etc/vpnc/post-connect.d/
cp build-aux/scripts/split.sh $(DESTDIR)/etc/vpnc/post-connect.d/split.sh
chmod 755 $(DESTDIR)/etc/vpnc/post-connect.d/split.sh
cp build-aux/debian/control $(DESTDIR)/DEBIAN/
echo "Version: $(RELEASE_VERSION)" >> $(DESTDIR)/DEBIAN/control
cp build-aux/debian/postinst $(DESTDIR)/DEBIAN/
chmod 775 $(DESTDIR)/DEBIAN/postinst
dpkg-deb --build $(DESTDIR) gohip-$(RELEASE_VERSION)-x86_64.deb
md5sum gohip-$(RELEASE_VERSION)-x86_64.deb > gohip-$(RELEASE_VERSION)-x86_64.deb.md5sum