Makefile 864 Bytes
Newer Older
Erick Hitter's avatar
Erick Hitter committed
1
PROJECT_NAME := "dyndnsd-client"
Erick Hitter's avatar
Erick Hitter committed
2
PKG := "git.ethitter.com/open-source/$(PROJECT_NAME)"
Erick Hitter's avatar
Erick Hitter committed
3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39
PKG_LIST := $(shell go list ${PKG}/... | grep -v /vendor/)
GO_FILES := $(shell find . -name '*.go' | grep -v /vendor/ | grep -v _test.go)

.PHONY: all dep build clean test coverage coverhtml lint

all: build

lint:
	@golint -set_exit_status ${PKG_LIST}

test:
	@go test -v ${PKG_LIST}

race: dep
	@go test -v -race ${PKG_LIST}

msan: dep
	@go test -v -msan ${PKG_LIST}

coverage:
	./tools/coverage.sh;

coverhtml:
	./tools/coverage.sh html;

dep:
	@go get -v -d ./...
	@go get github.com/mitchellh/gox

build: dep
	@gox -output="${CI_PROJECT_DIR}/${PROJECT_NAME}/{{.Dir}}_{{.OS}}_{{.Arch}}" -parallel=6

clean:
	@rm -f $(PROJECT_NAME)

help:
	@grep -h -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'