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