forked from Symantec/keymaster
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
57 lines (42 loc) · 1.77 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
51
52
53
54
55
56
57
# Set GOPATH to a sensible default if not already set.
ifdef USERPROFILE
GOPATH ?= $(USERPROFILE)\go
else
GOPATH ?= $(HOME)/go
endif
# This is how we want to name the binary output
BINARY=keymaster
# These are the values we want to pass for Version and BuildTime
VERSION=1.4.5
#BUILD_TIME=`date +%FT%T%z`
# Setup the -ldflags option for go build here, interpolate the variable values
#LDFLAGS=-ldflags "-X github.com/ariejan/roll/core.Version=${VERSION} -X github.com/ariejan/roll/core.BuildTime=${BUILD_TIME}"
all: init-config-host
cd $(GOPATH)/src; go install -ldflags "-X main.Version=${VERSION}" github.com/Symantec/keymaster/cmd/*
win-client:
cd $(GOPATH)\src && go install -ldflags "-X main.Version=${VERSION}" github.com\Symantec\keymaster\cmd\keymaster
cd $(GOPATH)\src\github.com\Symantec\keymaster\cmd\keymaster && go test -v ./...
get-deps: init-config-host
go get -t ./...
clean:
rm -f bin/*
rm -f keymaster-*.tar.gz
init-config-host:
@test -f cmd/keymaster/config_host.go || (cp -p templates/config_host_go cmd/keymaster/config_host.go && echo 'Created initial cmd/keymaster/config_host.go')
${BINARY}-${VERSION}.tar.gz:
mkdir ${BINARY}-${VERSION}
rsync -av --exclude="config.yml" --exclude="*.pem" --exclude="*.out" lib/ ${BINARY}-${VERSION}/lib/
rsync -av --exclude="config.yml" --exclude="*.pem" --exclude="*.out" --exclude="*.key" cmd/ ${BINARY}-${VERSION}/cmd/
rsync -av misc/ ${BINARY}-${VERSION}/misc/
cp LICENSE Makefile keymaster.spec README.md ${BINARY}-${VERSION}/
tar -cvzf ${BINARY}-${VERSION}.tar.gz ${BINARY}-${VERSION}/
rm -rf ${BINARY}-${VERSION}/
rpm: ${BINARY}-${VERSION}.tar.gz
rpmbuild -ta ${BINARY}-${VERSION}.tar.gz
tar: ${BINARY}-${VERSION}.tar.gz
test: init-config-host
go test -v ./...
format:
gofmt -s -w .
format-imports:
goimports -w .