mirror of
https://github.com/openshift/openshift-mcp-server.git
synced 2025-10-17 14:27:48 +03:00
feat: project bootstrap
This commit is contained in:
42
Makefile
Normal file
42
Makefile
Normal file
@@ -0,0 +1,42 @@
|
||||
# If you update this file, please follow
|
||||
# https://suva.sh/posts/well-documented-makefiles
|
||||
|
||||
## --------------------------------------
|
||||
## General
|
||||
## --------------------------------------
|
||||
|
||||
.DEFAULT_GOAL := help
|
||||
|
||||
BINARY_NAME=kubernetes-mcp-server
|
||||
LD_FLAGS=-s -w \
|
||||
-X '$(PACKAGE)/pkg/version.CommitHash=$(COMMIT_HASH)' \
|
||||
-X '$(PACKAGE)/pkg/version.BuildTime=$(BUILD_TIME)' \
|
||||
-X '$(PACKAGE)/pkg/version.BinaryName=$(BINARY_NAME)'
|
||||
COMMON_BUILD_ARGS=-ldflags "$(LD_FLAGS)"
|
||||
CLEAN_TARGETS:=
|
||||
|
||||
# The help will print out all targets with their descriptions organized bellow their categories. The categories are represented by `##@` and the target descriptions by `##`.
|
||||
# The awk commands is responsible to read the entire set of makefiles included in this invocation, looking for lines of the file as xyz: ## something, and then pretty-format the target and help. Then, if there's a line with ##@ something, that gets pretty-printed as a category.
|
||||
# More info over the usage of ANSI control characters for terminal formatting: https://en.wikipedia.org/wiki/ANSI_escape_code#SGR_parameters
|
||||
# More info over awk command: http://linuxcommand.org/lc3_adv_awk.php
|
||||
#
|
||||
# Notice that we have a little modification on the awk command to support slash in the recipe name:
|
||||
# origin: /^[a-zA-Z_0-9-]+:.*?##/
|
||||
# modified /^[a-zA-Z_0-9\/\.-]+:.*?##/
|
||||
.PHONY: help
|
||||
help: ## Display this help
|
||||
@awk 'BEGIN {FS = ":.*##"; printf "\nUsage:\n make \033[36m<target>\033[0m\n"} /^[a-zA-Z_0-9\/\.-]+:.*?##/ { printf " \033[36m%-21s\033[0m %s\n", $$1, $$2 } /^##@/ { printf "\n\033[1m%s\033[0m\n", substr($$0, 5) } ' $(MAKEFILE_LIST)
|
||||
|
||||
.PHONY: clean
|
||||
clean: ## Clean up all build artifacts
|
||||
rm -rf $(CLEAN_TARGETS)
|
||||
|
||||
.PHONY: build
|
||||
build: ## Build the project
|
||||
go build $(COMMON_BUILD_ARGS) -o $(BINARY_NAME) ./cmd/kubernetes-mcp-server
|
||||
|
||||
CLEAN_TARGETS+='$(BINARY_NAME)'
|
||||
|
||||
.PHONY: tidy
|
||||
tidy: ## Tidy up the go modules
|
||||
go mod tidy
|
||||
Reference in New Issue
Block a user