diff --git a/Makefile b/Makefile index 26c015d..f1dda00 100644 --- a/Makefile +++ b/Makefile @@ -19,7 +19,7 @@ DEB_PACKAGE_NAME := $(BINARY_NAME)_$(DEB_VERSION)_amd64.deb .PHONY: all all: build -# Build the binary +## build: - Build the binary .PHONY: build build: @echo "Building $(BINARY_NAME) version $(VERSION)..." @@ -27,14 +27,14 @@ build: @go build -ldflags "-X $(PKG_PATH).Version=$(VERSION) -X $(PKG_PATH).BuildTime=$(BUILD_TIME) -X $(PKG_PATH).GitCommit=$(GIT_COMMIT)" \ -o $(BUILD_DIR)/$(BINARY_NAME) . -# Clean build artifacts +## clean: - Clean build artifacts .PHONY: clean clean: @echo "Cleaning build artifacts..." @rm -rf $(BUILD_DIR) @rm -rf $(DIST_DIR) -# Build Debian package +## deb: - Build Debian package .PHONY: deb deb: build @echo "Building Debian package..." @@ -65,40 +65,32 @@ deb: build @mv $(DIST_DIR)/$(BINARY_NAME)_$(DEB_VERSION).deb $(DIST_DIR)/$(DEB_PACKAGE_NAME) @echo "Debian package created: $(DIST_DIR)/$(DEB_PACKAGE_NAME)" -# Install dependencies +## deps: - Installs Go mod dependencies .PHONY: deps deps: @echo "Installing dependencies..." @go mod download -# Run tests +## test: - Run tests .PHONY: test test: @echo "Running tests..." @go test ./... -# Format code +## fmt: - Format code .PHONY: fmt fmt: @echo "Formatting code..." @go fmt ./... -# Lint code +## lint: - Lint code .PHONY: lint lint: @echo "Linting code..." @go vet ./... -# Show help +## help: - Show make file usage .PHONY: help help: - @echo "Available targets:" - @echo " build - Build the binary in ./build directory" - @echo " deb - Build Debian package in ./dist directory" - @echo " clean - Clean build and dist directories" - @echo " deps - Install dependencies" - @echo " test - Run tests" - @echo " fmt - Format code" - @echo " lint - Lint code" - @echo " help - Show this help message" - + @echo "Usage:" + @sed -n 's/^##//p' ${MAKEFILE_LIST} | column -t -s ':' | sed -e 's/^/ /'