-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
40 lines (29 loc) · 1.1 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
# Go parameters
GOPATH ?= $(HOME)/go
#This is how we want to name the binary output
BINARY=smallpoint
# These are the values we want to pass for Version and BuildTime
VERSION=0.3.2
all: test build
build:
cd $(GOPATH)/src; go install -ldflags "-X main.Version=${VERSION}" github.com/Cloud-Foundations/SmallPoint/cmd/*
test:
go test -v ./...
clean:
go clean
rm -f $(BINARY_NAME)
rm -f ${BINARY}-${VERSION}.tar.gz
rm -f ${BINARY}-*.tar.gz
deps:
go get -t ./...
${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 --exclude="config.yml" --exclude="*.pem" --exclude="*.out" misc/ ${BINARY}-${VERSION}/misc/
cp LICENSE Makefile smallpoint.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