-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
33 lines (25 loc) · 890 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
PREFIX:=$(shell pwd)
BINDIR=$(PREFIX)/bin
BINARY=$(BINDIR)/$(shell basename `pwd`)
SRC=$(shell find . -name "*.go")
VERSION=$(shell cat VERSION)
REVISION=$(shell git rev-parse --short HEAD)
LDFLAGS=-X github.com/zengin-code/ginsa.VERSION=$(VERSION) \
-X github.com/zengin-code/ginsa.REVISION=$(REVISION)
GOFLAG=-ldflags "$(LDFLAGS)"
all: build
$(BINARY): $(SRC)
@go build $(GOFLAG) -o $@ github.com/zengin-code/ginsa/cli
build: $(BINARY)
gox:
@gox $(GOFLAG) -output "pkg/ginsa_{{.OS}}_{{.Arch}}/ginsa" github.com/zengin-code/ginsa/cli
@for target in `find pkg -type d -depth 1`; do\
(cd pkg; zip -r `basename $$target`.zip `basename $$target`); \
rm -rf $$target; \
done
release:
@git tag -f $(VERSION)
@git push --all
@ghr -u zengin-code -r ginsa $(VERSION) pkg
deps:
@git grep github.com | sed -e "s/\"$$//" | sed -e "s/^.*\"//" | sort | uniq | grep -v depscribe