-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathMakefile
41 lines (35 loc) · 874 Bytes
/
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
# Variables
APP_NAME := kaizen
GO_FILES := $(wildcard *.go)
BUILD_DIR := build
# Default target
.PHONY: all
all: build
# Build target
.PHONY: build
build:
@echo "Building $(APP_NAME) from $(GO_FILES)..."
@mkdir -p $(BUILD_DIR)
@go build -o $(BUILD_DIR)/$(APP_NAME) $(GO_FILES)
@echo "Build complete! Executable is in $(BUILD_DIR)/$(APP_NAME)"
# Run the app
.PHONY: run
run: build
@echo "Running $(APP_NAME)..."
@$(BUILD_DIR)/$(APP_NAME)
# Clean target
.PHONY: clean
clean:
@echo "Cleaning up..."
@rm -rf $(BUILD_DIR)
@echo "Cleanup complete!"
# Help target
.PHONY: help
help:
@echo "Makefile for $(APP_NAME)"
@echo "Usage:"
@echo " make Build the app (default target)"
@echo " make build Build the app"
@echo " make run Build and run the app"
@echo " make clean Remove build artifacts"
@echo " make help Show this help message"