-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
40 lines (31 loc) · 964 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
# 定义变量
APP_NAME = markdownProcessor
SRC = main.go markdown/processor.go
OUTPUT_DIR = bin
BUILD_DIR = $(OUTPUT_DIR)/$(APP_NAME)
# 默认目标
all: build
# 构建目标
build: linux-amd64 linux-arm64 darwin-amd64 windows-amd64
# 构建 Linux AMD64
linux-amd64:
GOOS=linux GOARCH=amd64 go build -o $(BUILD_DIR)-linux-amd64 $(SRC)
# 构建 Linux ARM64
linux-arm64:
GOOS=linux GOARCH=arm64 go build -o $(BUILD_DIR)-linux-arm64 $(SRC)
# 构建 macOS AMD64
darwin-amd64:
GOOS=darwin GOARCH=amd64 go build -o $(BUILD_DIR)-darwin-amd64 $(SRC)
# 构建 Windows AMD64
windows-amd64:
GOOS=windows GOARCH=amd64 go build -o $(BUILD_DIR)-windows-amd64.exe $(SRC)
# 清理目标
clean:
rm -rf $(OUTPUT_DIR)
# 显示帮助信息
help:
@echo "Makefile for building markdownProcessor"
@echo "Usage:"
@echo " make all # Build all targets"
@echo " make clean # Clean up build files"
@echo " make help # Show this help message"