From 91692d62151baa8c3d72b1da43aee7bd719ed137 Mon Sep 17 00:00:00 2001 From: Mikachu2333 Date: Sun, 12 Oct 2025 21:07:15 +0800 Subject: [PATCH] =?UTF-8?q?build(Makefile):=20=E6=9B=B4=E6=96=B0=E7=BC=96?= =?UTF-8?q?=E8=AF=91=E9=85=8D=E7=BD=AE=E4=BB=A5=E5=8C=85=E5=90=AB=E6=96=B0?= =?UTF-8?q?=E7=9A=84=E5=A4=B4=E6=96=87=E4=BB=B6=E8=B7=AF=E5=BE=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Makefile | 14 +++++++------- justfile | 10 +++++----- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/Makefile b/Makefile index 3a1184b..01640a4 100755 --- a/Makefile +++ b/Makefile @@ -62,7 +62,7 @@ endif #======== Compilation Config ========== -CFLAGS += -Iinclude -Ilib +CFLAGS += -Iinclude -Ilib -Isrc/framework -Isrc/res ifeq ($(On-Windows), 1) CLANG_FLAGS = -target x86_64-pc-windows-gnu @@ -151,10 +151,10 @@ build-in-release-mode: CFLAGS += $(CFLAGS_optimization) build-in-release-mode: @echo Starting: Build in RELEASE mode: \'$(CC)\' $(CFLAGS) -o $(ReleaseMode-Target-Name) ifeq ($(On-Windows), 1) - @if exist lib\chsrc.res del /Q lib\chsrc.res 2>nul - @windres lib\win_res.rc -O coff -o lib\chsrc.res -Iinclude -Ilib - @$(CC) src/chsrc-main.c lib/chsrc.res $(CFLAGS) $(_C_Warning_Flags) -o $(ReleaseMode-Target-Name) - @del /Q lib\chsrc.res 2>nul + @if exist src\\res\\chsrc.res del src\\res\\chsrc.res + @windres src\\res\\win_res.rc -O coff -o src\\res\\chsrc.res -Iinclude -Ilib -Isrc\\framework -Isrc\\res + @$(CC) src\\chsrc-main.c src\\res\\chsrc.res $(CFLAGS) $(_C_Warning_Flags) -o $(ReleaseMode-Target-Name) + @del src\\res\\chsrc.res else @$(CC) src/chsrc-main.c $(CFLAGS) $(_C_Warning_Flags) -o $(ReleaseMode-Target-Name) endif @@ -164,8 +164,8 @@ endif build-in-ci-release-mode: @echo Starting: Build in CI-RELEASE mode: \'$(CC)\' $(CFLAGS) -o $(CIReleaseMode-Target-Name) ifeq ($(On-Windows), 1) - @windres lib\win_res.rc -O coff -o lib\chsrc.res -Iinclude -Ilib - @$(CC) src/chsrc-main.c lib/chsrc.res $(CFLAGS) $(_C_Warning_Flags) -o $(CIReleaseMode-Target-Name) + @windres src\\res\\win_res.rc -O coff -o src\\res\\chsrc.res -Iinclude -Ilib -Isrc\\framework -Isrc\\res + @$(CC) src\\chsrc-main.c src\\res\\chsrc.res $(CFLAGS) $(_C_Warning_Flags) -o $(CIReleaseMode-Target-Name) else @$(CC) src/chsrc-main.c $(CFLAGS) $(_C_Warning_Flags) -o $(CIReleaseMode-Target-Name) endif diff --git a/justfile b/justfile index 081b4ef..3902916 100644 --- a/justfile +++ b/justfile @@ -53,7 +53,7 @@ CFLAGS_chk_Clang := if os() == 'windows' { } else {''} -CFLAGS_base := '-Iinclude -Ilib ' + CFLAGS_chk_Clang +CFLAGS_base := '-Iinclude -Ilib -Isrc/framework ' + CFLAGS_chk_Clang WARN := '-Wall -Wextra -Wno-unused-variable -Wno-unused-function -Wno-missing-braces -Wno-misleading-indentation' + ' ' + \ '-Wno-missing-field-initializers -Wno-unused-parameter -Wno-sign-compare' @@ -115,10 +115,10 @@ build-in-debug-mode: build-in-release-mode: @echo Starting: Build in RELEASE mode: '{{CC}}' {{CFLAGS_release_mode_prompt}} -o {{ReleaseMode-Target-Name}} - {{ if os() == 'windows' { '@if exist lib\\chsrc.res del lib\\chsrc.res' } else { '' } }} - {{ if os() == 'windows' { '@windres lib\\win_res.rc -O coff -o lib\\chsrc.res -Iinclude -Ilib' } else { '' } }} - {{ if os() == 'windows' { '@{{CC}} src/chsrc-main.c lib/chsrc.res {{CFLAGS_release_mode}} -o {{ReleaseMode-Target-Name}}' } else { '@{{CC}} src/chsrc-main.c {{CFLAGS_release_mode}} -o {{ReleaseMode-Target-Name}}' } }} - {{ if os() == 'windows' { '@del lib\\chsrc.res' } else { '' } }} + {{ if os() == 'windows' { '@if exist src\\res\\chsrc.res del src\\res\\chsrc.res' } else { '' } }} + {{ if os() == 'windows' { '@windres src\\res\\win_res.rc -O coff -o src\\res\\chsrc.res -Iinclude -Ilib -Isrc\\framework -Isrc\\res' } else { '' } }} + {{ if os() == 'windows' { '@' + CC + ' src/chsrc-main.c src/res/chsrc.res ' + CFLAGS_release_mode + ' -o ' + ReleaseMode-Target-Name } else { '@' + CC + ' src/chsrc-main.c ' + CFLAGS_release_mode + ' -o ' + ReleaseMode-Target-Name } }} + {{ if os() == 'windows' { '@del src\\res\\chsrc.res' } else { '' } }} @echo Finished: Build in RELEASE mode debug: build-in-debug-mode