]> git.lizzy.rs Git - micro.git/blob - Makefile
Get build date on Windows without Python
[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         mv micro $(GOPATH)/bin
21
22 # Same as 'build-all' but installs to $GOPATH/bin afterward
23 install-all: runtime install
24
25 # Same as 'build-quick' but installs to $GOPATH/bin afterward
26 install-quick: build-quick
27         mv micro $(GOPATH)/bin
28
29 # Updates tcell
30 tcell:
31         git -C $(GOPATH)/src/github.com/zyedidia/tcell pull
32
33 # Checks for dependencies
34 deps:
35         go get -d ./cmd/micro
36
37 # Builds the runtime
38 runtime:
39         go get -u github.com/jteeuwen/go-bindata/...
40         $(GOPATH)/bin/go-bindata -nometadata -o runtime.go runtime/...
41         mv runtime.go cmd/micro
42
43 test:
44         go get -d ./cmd/micro
45         go test ./cmd/micro
46
47 clean:
48         rm -f micro