-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
51 lines (43 loc) · 1.12 KB
/
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
# Variables
APP_NAME := Boss Payback
MAIN_FILE := main.go
BINARY_NAME := boss-payback
BINARY_PATH := ./bin/$(BINARY_NAME)
BUILD_DIR := ./bin
SRC_DIR := ./cmd
# Build the application
build:
@echo "Building $(APP_NAME)..."
@go build -o $(BINARY_PATH) $(SRC_DIR)/$(MAIN_FILE)
# Build first then Run the application
run:
@echo "Building $(APP_NAME)..."
@go build -o $(BINARY_PATH) $(SRC_DIR)/$(MAIN_FILE)
@echo "Running $(APP_NAME)..."
@$(BINARY_PATH)
# Clean build artifacts
clean:
@echo "Cleaning build artifacts..."
@rm -rf $(BUILD_DIR)
# Install dependencies
deps:
@echo "Installing dependencies..."
@go mod tidy
# Format the code
fmt:
@echo "Formatting code..."
@go fmt ./...
@echo "Formatting completed."
# Help target to display available make commands
help:
@echo "Usage: make [target]"
@echo ""
@echo "Targets:"
@echo " build Build the application"
@echo " run Run the application"
@echo " clean Clean build artifacts"
@echo " deps Install dependencies"
@echo " fmt Format the code"
@echo " help Display this help message"
# Default target
.DEFAULT_GOAL := help