2016-04-18 21:40:07 +03:00
|
|
|
.PHONY: runtime
|
|
|
|
|
2016-08-28 03:03:43 +03:00
|
|
|
VERSION = $(shell git describe --tags --abbrev=0)
|
|
|
|
HASH = $(shell git rev-parse --short HEAD)
|
2016-04-19 20:40:30 +03:00
|
|
|
|
2016-08-28 05:00:56 +03:00
|
|
|
# Builds micro after checking dependencies but without updating the runtime
|
|
|
|
build: deps tcell
|
2016-08-28 03:03:43 +03:00
|
|
|
go build -ldflags "-X main.Version=$(VERSION) -X main.CommitHash=$(HASH) -X 'main.CompileDate=$(shell date -u '+%B %d, %Y')'" -o micro ./cmd/micro
|
2016-03-21 19:51:45 +03:00
|
|
|
|
2016-08-28 05:00:56 +03:00
|
|
|
# Builds micro after building the runtiem and checking dependencies
|
|
|
|
build-all: runtime build
|
|
|
|
|
|
|
|
# Builds micro without checking for dependencies
|
|
|
|
build-quick:
|
|
|
|
go build -ldflags "-X main.Version=$(VERSION) -X main.CommitHash=$(HASH) -X 'main.CompileDate=$(shell date -u '+%B %d, %Y')'" -o micro ./cmd/micro
|
|
|
|
|
|
|
|
# Same as 'build' but installs to $GOPATH/bin afterward
|
2016-04-22 01:54:52 +03:00
|
|
|
install: build
|
2016-04-18 18:36:51 +03:00
|
|
|
mv micro $(GOPATH)/bin
|
2016-03-21 19:51:45 +03:00
|
|
|
|
2016-08-28 05:00:56 +03:00
|
|
|
# Same as 'build-all' but installs to $GOPATH/bin afterward
|
|
|
|
install-all: runtime install
|
|
|
|
|
|
|
|
# Same as 'build-quick' but installs to $GOPATH/bin afterward
|
|
|
|
install-quick: build-quick
|
|
|
|
mv micro $(GOPATH)/bin
|
|
|
|
|
|
|
|
# Updates tcell
|
2016-04-22 01:54:52 +03:00
|
|
|
tcell:
|
2016-08-18 21:31:09 +03:00
|
|
|
git -C $(GOPATH)/src/github.com/zyedidia/tcell pull
|
2016-04-27 04:23:52 +03:00
|
|
|
|
2016-08-28 05:00:56 +03:00
|
|
|
# Checks for dependencies
|
2016-04-27 04:23:52 +03:00
|
|
|
deps:
|
|
|
|
go get -d ./cmd/micro
|
2016-04-22 01:54:52 +03:00
|
|
|
|
2016-08-28 05:00:56 +03:00
|
|
|
# Builds the runtime
|
2016-04-18 16:35:53 +03:00
|
|
|
runtime:
|
2016-08-18 21:31:09 +03:00
|
|
|
go get -u github.com/jteeuwen/go-bindata/...
|
2016-08-26 21:38:20 +03:00
|
|
|
$(GOPATH)/bin/go-bindata -nometadata -o runtime.go runtime/...
|
2016-04-18 16:35:53 +03:00
|
|
|
mv runtime.go cmd/micro
|
2016-03-25 20:42:41 +03:00
|
|
|
|
|
|
|
test:
|
2016-04-18 13:59:41 +03:00
|
|
|
go get -d ./cmd/micro
|
|
|
|
go test ./cmd/micro
|
2016-03-25 20:42:41 +03:00
|
|
|
|
|
|
|
clean:
|
|
|
|
rm -f micro
|