forked from ekalinin/awsping
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
63 lines (49 loc) · 1.19 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
58
59
60
61
62
63
NAME=awsping
EXEC=${NAME}
GOVER=1.7.4
ENVNAME=${NAME}${GOVER}
BUILD_DIR=build
BUILD_OS="windows darwin freebsd linux"
BUILD_ARCH="amd64 386"
BUILD_DIR=build
build: deps
go build -o ${EXEC} main.go
deps:
echo "no deps yet"
run:
./${EXEC}
test:
@go test -v
release: buildall
git tag `grep "version" main.go | grep -o -E '[0-9]\.[0-9]\.[0-9]{1,2}'`
git push --tags origin master
clean:
@rm -f ${EXEC}
@rm -f ${BUILD_DIR}/*
@go clean
buildall: clean
@mkdir -p ${BUILD_DIR}
@for os in "${BUILD_OS}" ; do \
for arch in "${BUILD_ARCH}" ; do \
echo " * build $$os for $$arch"; \
GOOS=$$os GOARCH=$$arch go build -ldflags "-s" -o ${BUILD_DIR}/${EXEC}; \
cd ${BUILD_DIR}; \
tar czf ${EXEC}.$$os.$$arch.tgz ${EXEC}; \
cd - ; \
done done
@rm ${BUILD_DIR}/${EXEC}
#
# For virtual environment create with
# https://github.com/ekalinin/envirius
#
env-create: env-init env-deps
env-init:
@bash -c ". ~/.envirius/nv && nv mk ${ENVNAME} --go-prebuilt=${GOVER}"
env-build:
@bash -c ". ~/.envirius/nv && nv do ${ENVNAME} 'make build'"
env-deps:
@bash -c ". ~/.envirius/nv && nv do ${ENVNAME} 'make deps'"
env:
@bash -c ". ~/.envirius/nv && nv use ${ENVNAME}"
docker:
docker build -t awsping .