-
Notifications
You must be signed in to change notification settings - Fork 26
/
Makefile
40 lines (30 loc) · 904 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
VERSION := $(shell awk -F= '/version =/ {print $$2}' lib/root.go | tr -d "\" ")
test:
go test -v ./...
all:
go build -v
release:
@$(MAKE) linux_amd64
@$(MAKE) linux_386
@$(MAKE) linux_arm
@$(MAKE) darwin_amd64
linux_amd64: GOOS=linux
linux_amd64: GOARCH=amd64
linux_amd64: build
linux_386: GOOS=linux
linux_386: GOARCH=386
linux_386: build
linux_arm: GOOS=linux
linux_arm: GOARCH=arm
linux_arm: build
darwin_amd64: GOOS=darwin
darwin_amd64: GOARCH=amd64
darwin_amd64: build
build:
env GOOS=${GOOS} GOARCH=${GOARCH} go build -o bin/sman-${GOOS}-${GOARCH}-v${VERSION}
cd bin; tar -czf sman-${GOOS}-${GOARCH}-v${VERSION}.tgz sman-${GOOS}-${GOARCH}-v${VERSION}
rm bin/sman-${GOOS}-${GOARCH}-v${VERSION}
watch:
CompileDaemon -command="go test -v ./..." -color=True --log-prefix=False --exclude-dir=.git
.PHONY: all release linux_amd64 linux_386 linux_arm \
darwin_amd64 build test watch