Only use $(OS) to ensure MSYS2

This commit is contained in:
Aoran Zeng
2025-10-15 18:33:21 +08:00
parent 8ebe5812ed
commit 28d8e4ad0c
2 changed files with 9 additions and 5 deletions

View File

@@ -2,13 +2,13 @@
# -------------------------------------------------------------- # --------------------------------------------------------------
# SPDX-License-Identifier: GPL-3.0-or-later # SPDX-License-Identifier: GPL-3.0-or-later
# -------------------------------------------------------------- # --------------------------------------------------------------
# Build File : Makefile # Build File : Makefile
# File Authors : Aoran Zeng <ccmywish@qq.com> # File Authors : 曾奥然 <ccmywish@qq.com>
# Contributors : Yangmoooo <yangmoooo@outlook.com> # Contributors : Yangmoooo <yangmoooo@outlook.com>
# | sanchuanhehe <wyihe5520@gmail.com> # | sanchuanhehe <wyihe5520@gmail.com>
# | # |
# Created On : <2023-08-28> # Created On : <2023-08-28>
# Last Modified : <2025-07-22> # Last Modified : <2025-10-15>
# #
# 请阅读 ./doc/01-开发与构建.md 来使用 # 请阅读 ./doc/01-开发与构建.md 来使用
# -------------------------------------------------------------- # --------------------------------------------------------------
@@ -26,10 +26,12 @@ ifeq ($(shell uname), Darwin)
On-macOS = 1 On-macOS = 1
endif endif
# 只有Windows会定义$(OS)变量 # 只有 MSYS2 会定义 $(OS) 变量
ifeq ($(OS), Windows_NT) ifeq ($(OS), Windows_NT)
On-Windows = 1 On-Windows = 1
endif endif
# 注意, 原生 Windows 会定义 $(ComSpec) 变量,且区分大小写
# 但是 MSYS2 并不会定义
#===================================== #=====================================
@@ -196,6 +198,7 @@ test-cli: $(DevMode-Target-Name)
clean: clean:
-@rm *.exe 2>/dev/null -@rm *.exe 2>/dev/null
-@rm *.res 2>/dev/null
-@rm xy 2>/dev/null -@rm xy 2>/dev/null
-@rm fw 2>/dev/null -@rm fw 2>/dev/null
-@rm README.md.bak* 2>/dev/null -@rm README.md.bak* 2>/dev/null

View File

@@ -148,6 +148,7 @@ test-cli:
clean: clean:
-@{{BIN_rm}} *.exe -@{{BIN_rm}} *.exe
-@{{BIN_rm}} *.res
-@{{BIN_rm}} xy -@{{BIN_rm}} xy
-@{{BIN_rm}} fw -@{{BIN_rm}} fw
-@{{BIN_rm}} chsrc -@{{BIN_rm}} chsrc