-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
41 lines (28 loc) · 799 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
41
BINARY=simplepush
OS=linux openbsd darwin windows
VERSION=`git describe --tags --always --dirty`
LDFLAGS=-ldflags "-X main.Version=${VERSION}"
all: test build
get-deps:
build: get-deps
cd cmd/simplepush && go build ${LDFLAGS} -o ../../${BINARY}
test: get-deps
go test
install:
cd cmd/simplepush && go install ${LDFLAGS}
release:
cd cmd/simplepush && \
for os in ${OS}; do \
GOOS=$$os GOARCH=amd64 go build ${LDFLAGS} -o ../../${BINARY}-$$os-amd64; \
done
cd cmd/simplepush && GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go build ${LDFLAGS} -o ../../${BINARY}-alpine-amd64
doc: build
clean:
for os in ${OS}; do \
f=${BINARY}-$$os-amd64; \
if [ -f $$f ] ; then rm $$f ; fi; \
done
rm -f ${BINARY} ${BINARY}-alpine-amd64
distclean: clean
rm -f ${BINARY}.1
.PHONY: clean install