doodle/Makefile
Noah Petherbridge 5bf7d554f7 Add doodad.exe binary and PNG to Drawing Converter
Adds the `doodad` binary which will be a command line tool to work with
Doodads and Levels and assist with development.

The `doodad` binary has subcommands like git and the first command is
`convert` which converts between image files (PNG or BMP) and Doodle
drawing files (Level or Doodad). You can "screenshot" a level into a PNG
or you can initialize a new drawing from a PNG.
2018-10-16 12:26:41 -07:00

41 lines
907 B
Makefile

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
go build $(LDFLAGS) -i -o bin/doodad cmd/doodad/main.go
# `make run` to run it in debug mode.
.PHONY: run
run:
go run cmd/doodle/main.go -debug
# `make guitest` to run it in guitest mode.
.PHONY: guitest
guitest:
go run cmd/doodle/main.go -debug -guitest
# `make test` to run unit tests.
.PHONY: test
test:
go test ./...
# `make clean` cleans everything up.
.PHONY: clean
clean:
rm -rf bin dist