-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
50 lines (35 loc) · 1.33 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
50
ifndef GOPATH
GOPATH := $(HOME)/go
endif
ifndef GOOS
GOOS := linux
endif
ifndef GO111MODULE
GO111MODULE := on
endif
PREFIX ?= "/opt/cluster"
VERSION ?= "master"
CACERTDIR ?= "/etc/pki/tls/certs"
GOLDFLAGS = "-X github.com/Donders-Institute/hpc-utility/internal/cmd.defTorqueHelperCert=/etc/pki/tls/certs/star_dccn_nl.chained.crt \
-X github.com/Donders-Institute/hpc-utility/internal/cmd.defWebhookCert=/etc/pki/tls/certs/star_dccn_nl.chained.crt \
-X github.com/Donders-Institute/hpc-utility/internal/cmd.defMachineListFile=/opt/cluster/etc/machines.mentat \
-X github.com/Donders-Institute/hpc-utility/internal/cmd.defVersion=$(VERSION)"
.PHONY: build
all: build
build:
GOPATH=$(GOPATH) GOOS=$(GOOS) GO111MODULE=$(GO111MODULE) go install -ldflags $(GOLDFLAGS) github.com/Donders-Institute/hpc-utility/...
doc:
@GOPATH=$(GOPATH) GOOS=$(GOOS) godoc -http=:6060
test:
@GOPATH=$(GOPATH) GOOS=$(GOOS) go test \
-ldflags $(GOLDFLAGS) -v github.com/Donders-Institute/hpc-utility/...
install: build
@install -D $(GOPATH)/bin/* $(PREFIX)/bin
release:
VERSION=$(VERSION) rpmbuild --undefine=_disable_source_fetch -bb build/rpm/centos7.spec
github_release:
scripts/gh-release.sh $(VERSION) false
clean:
@rm -rf $(GOPATH)/bin/cluster-*
@rm -rf $(GOPATH)/pkg/*/Donders-Institute/hpc-utility
@rm -rf $(GOPATH)/pkg/*/Donders-Institute/hpc-utility