From 525cf88118bd6ab35badf58c8f83d5779d34ad59 Mon Sep 17 00:00:00 2001 From: Vincent Demeester Date: Thu, 25 Jan 2024 16:17:09 +0100 Subject: [PATCH] Add a Makefile to the repository Signed-off-by: Vincent Demeester --- Makefile | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 Makefile diff --git a/Makefile b/Makefile new file mode 100644 index 00000000..07670e5b --- /dev/null +++ b/Makefile @@ -0,0 +1,39 @@ +BIN = catalog-cd + +GOFLAGS ?= -v +GOFLAGS_TEST ?= -v -cover + +ARGS ?= + +.EXPORT_ALL_VARIABLES: + +all: help + +.PHONY: $(BIN) +$(BIN): + go build -o $(BIN) . $(ARGS) + +.PHONY: build +build: $(BIN) + +.PHONY: run +run: + go run . $(ARGS) + +install: + go install $(CMD) + +test: test-unit + +.PHONY: test-unit +test-unit: + go test $(GOFLAGS_TEST) ./... + +.PHONY: watch +catalog-cd-watch: ## Watch go files and rebuild catalog-cd on changes (needs entr). + find . -name '*.go' | entr -r go build -v . + +.PHONY: help +help: + @grep -hE '^[ a-zA-Z0-9_-]+:.*?## .*$$' $(MAKEFILE_LIST) | \ + awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-17s\033[0m %s\n", $$1, $$2}'