2017-10-27 01:03:11 +00:00
|
|
|
SHELL := /bin/bash
|
|
|
|
|
|
|
|
VERSION=$(shell grep -e 'Version' doodle.go | head -n 1 | cut -d '"' -f 2)
|
|
|
|
BUILD=$(shell git describe --always)
|
|
|
|
CURDIR=$(shell curdir)
|
|
|
|
|
|
|
|
# Inject the build version (commit hash) into the executable.
|
|
|
|
LDFLAGS := -ldflags "-X main.Build=$(BUILD)"
|
|
|
|
|
|
|
|
# `make setup` to set up a new environment, pull dependencies, etc.
|
|
|
|
.PHONY: setup
|
|
|
|
setup: clean
|
|
|
|
go get -u ./...
|
|
|
|
|
|
|
|
# `make build` to build the binary.
|
|
|
|
.PHONY: build
|
|
|
|
build:
|
|
|
|
gofmt -w .
|
|
|
|
go build $(LDFLAGS) -i -o bin/doodle cmd/doodle/main.go
|
2018-10-16 16:20:25 +00:00
|
|
|
go build $(LDFLAGS) -i -o bin/doodad cmd/doodad/main.go
|
2017-10-27 01:03:11 +00:00
|
|
|
|
|
|
|
# `make run` to run it in debug mode.
|
|
|
|
.PHONY: run
|
|
|
|
run:
|
|
|
|
go run cmd/doodle/main.go -debug
|
|
|
|
|
2018-10-08 17:38:49 +00:00
|
|
|
# `make guitest` to run it in guitest mode.
|
|
|
|
.PHONY: guitest
|
|
|
|
guitest:
|
|
|
|
go run cmd/doodle/main.go -debug -guitest
|
|
|
|
|
2017-10-27 01:03:11 +00:00
|
|
|
# `make test` to run unit tests.
|
|
|
|
.PHONY: test
|
|
|
|
test:
|
|
|
|
go test ./...
|
|
|
|
|
|
|
|
# `make clean` cleans everything up.
|
|
|
|
.PHONY: clean
|
|
|
|
clean:
|
2017-10-27 02:26:54 +00:00
|
|
|
rm -rf bin dist
|