Updated Makefile to introduce new targets for development and configuration generation, replacing the run target with an alias for dev. Enhanced help output for clarity on available commands.

This commit is contained in:
2026-05-31 17:45:11 -05:00
parent f049dc942b
commit 4e23a7b3f4
+12 -5
View File
@@ -4,20 +4,27 @@ BIN_DIR := ./bin
BIN := $(BIN_DIR)/$(APP_NAME)
CONFIG ?= config.yaml
.PHONY: help run build test fmt clean
.PHONY: help run dev generate-config build test fmt clean
help:
@echo "Targets:"
@echo " make run - Run the server (CONFIG=$(CONFIG))"
@echo " make run - Alias for make dev"
@echo " make dev - Build and run server (CONFIG=$(CONFIG))"
@echo " make generate-config - Write default config to $(CONFIG)"
@echo " make build - Build binary to $(BIN)"
@echo " make test - Run all Go tests"
@echo " make fmt - Format Go code"
@echo " make clean - Remove built artifacts"
run:
go run $(CMD_DIR) server --config $(CONFIG)
run: dev
build:
dev: build
$(BIN) server --config $(CONFIG)
generate-config:
go run $(CMD_DIR) generate-config > $(CONFIG)
build: clean
mkdir -p $(BIN_DIR)
go build -o $(BIN) $(CMD_DIR)