From d2df940aa6a892da967dfb19fed93f0b37b95915 Mon Sep 17 00:00:00 2001 From: LuChiChick <1084116302@qq.com> Date: Thu, 11 Sep 2025 00:42:57 +0800 Subject: [PATCH] Modified the compilation rules for static compilation and dependency files. --- Makefile | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index 7f2893d..4f818e3 100644 --- a/Makefile +++ b/Makefile @@ -178,13 +178,13 @@ $(BUILD_DIR)/$(SUB_DIR_DEBUG): | $(BUILD_DIR) # Release 最终可执行文件编译任务 $(BUILD_DIR)/$(SUB_DIR_RELEASE)/$(TARGET_FILE_NAME).exe: $(RELEASE_OBJECTS) @echo ====== [Release] All File Compiled. Now Linking... ====== - $(C++_COMPLIER) $(RELEASE_OBJECTS) -o $@ $(LIB_LINK) $(LDFLAGS) + $(C++_COMPLIER) $(RELEASE_OBJECTS) -static -o $@ $(LIB_LINK) $(LDFLAGS) @echo ====== [Release] Program Link Finished ====== # Debug 最终可执行文件编译任务 $(BUILD_DIR)/$(SUB_DIR_DEBUG)/$(TARGET_FILE_NAME).exe: $(DEBUG_OBJECTS) @echo ====== [Debug] All File Compiled. Now Linking... ====== - $(C++_COMPLIER) $(DEBUG_OBJECTS) -o $@ $(LIB_LINK) $(LDFLAGS) + $(C++_COMPLIER) $(DEBUG_OBJECTS) -static -o $@ $(LIB_LINK) $(LDFLAGS) @echo ====== [Debug] Program Link Finished ====== # C Release 目标文件编译 @@ -219,5 +219,5 @@ $(BUILD_DIR)/$(SUB_DIR_DEBUG)/%.o: %.rc Makefile | $(BUILD_DIR)/$(SUB_DIR_DEBUG) # 依赖关系 --include $(wildcard $(BUILD_DIR)/$(SUB_DIR_RELEASE)*.d) --include $(wildcard $(BUILD_DIR)/$(SUB_DIR_DEBUG)*.d) \ No newline at end of file +-include $(RELEASE_OBJECTS:.o=.d) +-include $(DEBUG_OBJECTS:.o=.d) \ No newline at end of file