-
-
Notifications
You must be signed in to change notification settings - Fork 8
/
Makefile
31 lines (21 loc) · 785 Bytes
/
Makefile
1
2
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
BINARY_NAME=terramaid
VERSION=v1
GO=go
default: help
help: ## List Makefile targets
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
all: build
fmt: ## Format Go files
gofumpt -w .
build: ## Build Terramaid
env $(if $(GOOS),GOOS=$(GOOS)) $(if $(GOARCH),GOARCH=$(GOARCH)) $(GO) build -o build/$(BINARY_NAME) -ldflags "-X 'github.com/rosesecurity/Terramaid/cmd.Version=local'" main.go
install: ## Install dependencies
$(GO) install ./...@latest
clean: ## Clean up build artifacts
$(GO) clean
rm ./build/$(BINARY_NAME)
run: build ## Run Terramaid
./build/$(BINARY_NAME)
docs: build ## Generate documentation
./build/$(BINARY_NAME) docs
.PHONY: all build install clean run fmt help