1
0
mirror of https://github.com/danog/gojekyll.git synced 2024-11-30 11:19:01 +01:00
gojekyll/Makefile

44 lines
1.2 KiB
Makefile
Raw Normal View History

2017-06-20 15:00:04 +02:00
SOURCEDIR=.
SOURCES := $(shell find $(SOURCEDIR) -name '*.go')
BINARY = gojekyll
PACKAGE = github.com/osteele/gojekyll
COMMIT_HASH = `git rev-parse --short HEAD 2>/dev/null`
BUILD_TIME = `date +%FT%T%z`
VERSION=0.0.0
LDFLAGS=-ldflags "-X ${PACKAGE}.Version=${VERSION} -X ${PACKAGE}.BuildTime=${BUILD_TIME}"
.DEFAULT_GOAL: $(BINARY)
.PHONY: build clean dependencies setup install lint test help
$(BINARY): $(SOURCES)
go build ${LDFLAGS} -o ${BINARY} ${PACKAGE}/cmd/gojekyll
build: $(BINARY) ## compile the package
clean: ## remove binary files
rm -fI ${BINARY}
2017-06-22 23:37:32 +02:00
deps: ## list dependencies
go list -f '{{join .Imports "\n"}}' ./... | grep -v ${PACKAGE} | grep '\.' | sort | uniq
2017-06-20 15:00:04 +02:00
setup: ## install dependencies and development tools
2017-06-22 14:33:09 +02:00
go get -t ./...
2017-06-20 15:00:04 +02:00
go get -u github.com/alecthomas/gometalinter
gometalinter --install
install: ## compile and install the executable
go install ${LDFLAGS} ${PACKAGE}/cmd/gojekyll
lint: ## lint the package
2017-07-04 15:09:36 +02:00
gometalinter ./... --disable=gotype
2017-06-20 15:00:04 +02:00
test: ## test the package
go test ./...
2017-06-20 15:00:04 +02:00
# Source: https://marmelab.com/blog/2016/02/29/auto-documented-makefile.html
help:
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'