2024-11-14 11:35:22 +08:00
|
|
|
# 定义项目路径
|
|
|
|
PROJECT_DIR := $(shell pwd)
|
|
|
|
|
|
|
|
# 定义输出二进制文件的路径
|
|
|
|
BIN_DIR := dist
|
|
|
|
|
|
|
|
# 定义应用程序的名称
|
2024-11-16 13:18:22 +08:00
|
|
|
APPS := tunnelserver tunnelclient tunnelagent
|
2024-11-14 11:35:22 +08:00
|
|
|
|
|
|
|
# 创建输出目录
|
|
|
|
$(BIN_DIR):
|
|
|
|
mkdir -p $(BIN_DIR)
|
|
|
|
|
|
|
|
# 构建所有应用程序
|
|
|
|
build: $(BIN_DIR)
|
|
|
|
$(foreach app,$(APPS),$(MAKE) -C $(app);)
|
|
|
|
|
|
|
|
# 清理构建文件
|
|
|
|
clean:
|
|
|
|
$(foreach app,$(APPS),$(MAKE) -C $(app) clean;)
|
|
|
|
rm -rf $(BIN_DIR)
|
|
|
|
|
|
|
|
# 运行测试
|
|
|
|
test:
|
|
|
|
$(foreach app,$(APPS),$(MAKE) -C $(app) test;)
|
|
|
|
|
|
|
|
# 运行所有任务
|
|
|
|
all: clean build
|
|
|
|
|
|
|
|
.PHONY: build clean test all
|