all repos — disgord @ 451c462955a02ed969386fe816392b8e1fc1cfe2

A simple Discord bot in Go.

Makefile (view raw)

 1# Variables
 2APP_NAME=disgord
 3COMMIT_HASH=$(shell git rev-parse --short HEAD)
 4BUILD_DIR=dist
 5SRC_DIR=src
 6
 7# Build flags for versioning
 8LDFLAGS=-ldflags "-X github.com/BiRabittoh/disgord/src/globals.CommitID=$(COMMIT_HASH)"
 9
10.PHONY: all build test run clean
11
12# Default command: build the application
13all: build
14
15# Build the Go application
16build:
17	@echo "Building $(APP_NAME)..."
18	@mkdir -p $(BUILD_DIR)
19	CGO_ENABLED=0 go build $(LDFLAGS) -trimpath -o $(BUILD_DIR)/$(APP_NAME)
20
21# Run tests
22test:
23	@echo "Running tests..."
24	go test -v ./...
25
26# Run the application
27run:
28	@echo "Running $(APP_NAME)..."
29	go run .
30
31# Clean up build artifacts
32clean:
33	@echo "Cleaning up..."
34	@rm -rf $(BUILD_DIR)