-
Notifications
You must be signed in to change notification settings - Fork 12
/
Makefile
38 lines (30 loc) · 1.08 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
# godel_version is only used to ensure all the godel bits
# have been downloaded before determining the project-version.
godel_version := $(shell ./godelw version)
version := $(shell ./godelw project-version)
package_path = ./out/package
package_version = $(package_path)/$(version)
platforms = windows-amd64 linux-amd64 windows-386 linux-386
package: $(platforms)
clean:
./godelw clean
rm -rf $(package_path)
rm -f coverage.txt coverage.html
test:
go test -v ./...
test-godel:
./godelw test
coverage:
go test -race -coverprofile=coverage.txt -covermode=atomic ./...
go tool cover -html=coverage.txt -o coverage.html
release: clean package
ghr $(version) $(package_path)
build:
./godelw build
$(platforms): build
$(eval package_bin = $(package_version)/$@/bin)
mkdir -p $(package_bin)
ln ./out/build/*/$(version)*/$@/* $(package_bin)/.
tar -zcvf $(package_path)/nagiosfoundation-$@-$(version).tgz -C $(package_version)/$@ bin
(cd $(package_path) && sha512sum nagiosfoundation-$@-$(version).tgz) > $(package_path)/nagiosfoundation-$@-$(version)-sha512.txt
rm -rf $(package_version)