-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
41 lines (32 loc) · 798 Bytes
/
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
PKGNAME=seeddms-munin
VERSION=0.0.1
TARGET=http://seeddms.steinmann.cx/restapi/index.php
APIKEY=d34c8dab1483f51a9f6a0d8dc8d5348c
GOCMD=go
GOBUILD=$(GOCMD) build
GOCLEAN=$(GOCMD) clean
GOTEST=$(GOCMD) test
GOVET=$(GOCMD) vet
GOGET=$(GOCMD) get
default: build
build: test
mkdir -p bin
$(GOBUILD) -v -o bin/${PKGNAME} main.go
clean:
$(GOCLEAN)
rm -rf bin
test:
$(GOVET) ./...
$(GOTEST) -v ./...
run:
target=${TARGET} apikey=${APIKEY} bin/${PKGNAME} run
dist: clean
rm -rf ${PKGNAME}-${VERSION}
mkdir ${PKGNAME}-${VERSION}
cp -r *.go Makefile go.mod LICENSE ${PKGNAME}-${VERSION}
tar czvf ${PKGNAME}-${VERSION}.tar.gz ${PKGNAME}-${VERSION}
rm -rf ${PKGNAME}-${VERSION}
debian: dist
mv ${PKGNAME}-${VERSION}.tar.gz ../${PKGNAME}_${VERSION}.orig.tar.gz
debuild
.PHONY: build test