2017-06-27 19:25:07 +02:00
|
|
|
SOURCEDIR=.
|
|
|
|
SOURCES := $(shell find $(SOURCEDIR) -name '*.go')
|
|
|
|
|
|
|
|
LIBRARY = liquid
|
|
|
|
PACKAGE = github.com/osteele/liquid
|
|
|
|
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}"
|
|
|
|
|
2017-06-28 00:10:12 +02:00
|
|
|
.DEFAULT_GOAL: ci
|
|
|
|
.PHONY: build clean ci dependencies setup install lint test help
|
|
|
|
|
|
|
|
ci: setup test #lint
|
2017-06-27 19:25:07 +02:00
|
|
|
|
|
|
|
$(LIBRARY): $(SOURCES)
|
2017-06-28 00:10:12 +02:00
|
|
|
go build ${LDFLAGS} -o ${LIBRARY} ${PACKAGE}
|
2017-06-27 19:25:07 +02:00
|
|
|
|
|
|
|
build: $(LIBRARY) ## compile the package
|
|
|
|
|
|
|
|
clean: ## remove binary files
|
|
|
|
rm -fI ${LIBRARY}
|
|
|
|
|
2017-06-29 17:15:13 +02:00
|
|
|
deps: ## list dependencies
|
|
|
|
go list -f '{{join .Imports "\n"}}' ./... | grep -v ${PACKAGE} | grep '\.' | sort | uniq
|
|
|
|
|
2017-07-02 14:01:12 +02:00
|
|
|
install-dev-tools: ## install dependencies and development tools
|
2017-06-27 19:25:07 +02:00
|
|
|
go get -t ./...
|
|
|
|
go get github.com/alecthomas/gometalinter
|
|
|
|
go get golang.org/x/tools/cmd/stringer
|
|
|
|
go install golang.org/x/tools/cmd/goyacc
|
|
|
|
gometalinter --install
|
|
|
|
|
|
|
|
lint: ## lint the package
|
2017-07-02 15:09:23 +02:00
|
|
|
gometalinter ./... --deadline=5m --exclude expressions/scanner.go --exclude y.go --exclude '.*_string.go'
|
2017-06-27 19:25:07 +02:00
|
|
|
|
|
|
|
test: ## test the package
|
|
|
|
go test ./...
|
|
|
|
|
|
|
|
# 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}'
|