A web blog and personal homepage engine written in Go.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

54 lines
1.4 KiB

SHELL := /bin/bash
VERSION=$(shell grep -e 'Version =' pkg/version.go | head -n 1 | cut -d '"' -f 2)
BUILD=$(shell git describe --always)
BUILD_DATE=$(shell date +"%Y-%m-%dT%H:%M:%S%z")
CURDIR=$(shell curdir)
# Inject the build version (commit hash) into the executable.
LDFLAGS := -ldflags "-X main.Build=$(BUILD) -X main.BuildDate=$(BUILD_DATE)"
# `make setup` to set up a new environment, pull dependencies, etc.
.PHONY: setup
setup: clean
go get -u github.com/go-bindata/go-bindata/...
go get ./...
# `make build` to build the binary.
.PHONY: build
go build $(LDFLAGS) -i -o bin/gophertype cmd/gophertype/main.go
# `make buildall` to run all build steps including doodads and bindata.
.PHONY: buildall
buildall: bindata build
# `make bindata` generates the embedded binary assets package.
.PHONY: bindata
go-bindata -pkg bundled -o pkg/bundled/bindata.go -prefix pvt-www pvt-www/...
# `make bindata-dev` generates the debug version of bindata package.
.PHONY: bindata-dev
go-bindata -debug -pkg bundled -o pkg/bundled/bindata.go -prefix pvt-www pvt-www/...
# `make install` to install the Go binaries to your GOPATH.
.PHONY: install
go install git.kirsle.net/apps/gophertype/cmd/gophertype
# `make run` to run it in debug mode.
.PHONY: run
go run cmd/gophertype/main.go -debug
# `make test` to run unit tests.
.PHONY: test
go test ./...
# `make clean` cleans everything up.
.PHONY: clean
rm -rf bin