diff --git a/.gitignore b/.gitignore index 0b1d417..1ed47e4 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,4 @@ logs -build +bin *.sql config.json \ No newline at end of file diff --git a/Makefile b/Makefile index ff3f716..a8edfa3 100644 --- a/Makefile +++ b/Makefile @@ -1,19 +1,27 @@ -MAIN_PKG=./cmd/server - +MAIN_PKG :=./cmd/server BIN_NAME ?= laterna -BIN_DIR=build +BIN_DIR := bin +CONFIG_FILE := config.json +.DEFAULT_GOAL := build build: - @mkdir -p ${BIN_DIR} - @echo "๐Ÿ”ง Building binary using the standard go compiler..." - cp config.json build - go build -o $(BIN_DIR)/$(BIN_NAME) $(MAIN_PKG) + @mkdir -p $(BIN_DIR) + @echo "๐Ÿ”ง Building binary..." + @cp $(CONFIG_FILE) $(BIN_DIR)/ + @go build -o $(BIN_DIR)/$(BIN_NAME) $(MAIN_PKG) @echo "โœ… Build complete: $(BIN_DIR)/$(BIN_NAME)" run: - go run ./cmd/server/ + @echo "๐Ÿš€ Running server..." + @go run $(MAIN_PKG) clean: - rm -rf ${BIN_DIR} - rm -rf logs/ - go mod tidy + @echo "๐Ÿงน Cleaning up..." + @rm -rf $(BIN_DIR) logs/ + @go mod tidy +help: + @echo "Makefile targets:" + @echo " build โ€“ Build the binary" + @echo " run โ€“ Run the development server" + @echo " clean โ€“ Remove build artifacts and tidy modules" + @echo " help โ€“ Show this help message" \ No newline at end of file diff --git a/README.md b/README.md index eb39f21..701b4b0 100644 --- a/README.md +++ b/README.md @@ -27,12 +27,12 @@ You can leave the json as it is or configure it to your liking, although some co Make sure that go is installed. The server was tested with go 1.24.5 on linux. -`$ go run ./cmd/server` - -or use the makefile: - +run using the makefile `$ make run` +for further makefile usage, see +`$ make help` + ## ๐Ÿ›œ API Documentation
Docs