]> git.lizzy.rs Git - micro.git/blob - Makefile
Merge pull request #387 from boombuler/bug379
[micro.git] / Makefile
1 .PHONY: runtime
2
3 VERSION = $(shell git describe --tags --abbrev=0)
4 HASH = $(shell git rev-parse --short HEAD)
5 DATE = $(shell go run tools/build-date.go)
6
7 # Builds micro after checking dependencies but without updating the runtime
8 build: deps tcell
9         go build -ldflags "-X main.Version=$(VERSION) -X main.CommitHash=$(HASH) -X 'main.CompileDate=$(DATE)'" ./cmd/micro
10
11 # Builds micro after building the runtime and checking dependencies
12 build-all: runtime build
13
14 # Builds micro without checking for dependencies
15 build-quick:
16         go build -ldflags "-X main.Version=$(VERSION) -X main.CommitHash=$(HASH) -X 'main.CompileDate=$(DATE)'" ./cmd/micro
17
18 # Same as 'build' but installs to $GOPATH/bin afterward
19 install: build
20         mkdir -p $(GOPATH)/bin
21         mv micro $(GOPATH)/bin
22
23 # Same as 'build-all' but installs to $GOPATH/bin afterward
24 install-all: runtime install
25
26 # Same as 'build-quick' but installs to $GOPATH/bin afterward
27 install-quick: build-quick
28         mkdir -p $(GOPATH)/bin
29         mv micro $(GOPATH)/bin
30
31 # Updates tcell
32 tcell:
33         git -C $(GOPATH)/src/github.com/zyedidia/tcell pull
34
35 # Checks for dependencies
36 deps:
37         go get -d ./cmd/micro
38
39 # Builds the runtime
40 runtime:
41         go get -u github.com/jteeuwen/go-bindata/...
42         $(GOPATH)/bin/go-bindata -nometadata -o runtime.go runtime/...
43         mv runtime.go cmd/micro
44
45 test:
46         go get -d ./cmd/micro
47         go test ./cmd/micro
48
49 clean:
50         rm -f micro