Skip to content

Commit 91692d6

Browse files
committed
build(Makefile): 更新编译配置以包含新的头文件路径
1 parent 6aac016 commit 91692d6

File tree

2 files changed

+12
-12
lines changed

2 files changed

+12
-12
lines changed

Makefile

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ endif
6262

6363

6464
#======== Compilation Config ==========
65-
CFLAGS += -Iinclude -Ilib
65+
CFLAGS += -Iinclude -Ilib -Isrc/framework -Isrc/res
6666

6767
ifeq ($(On-Windows), 1)
6868
CLANG_FLAGS = -target x86_64-pc-windows-gnu
@@ -151,10 +151,10 @@ build-in-release-mode: CFLAGS += $(CFLAGS_optimization)
151151
build-in-release-mode:
152152
@echo Starting: Build in RELEASE mode: \'$(CC)\' $(CFLAGS) -o $(ReleaseMode-Target-Name)
153153
ifeq ($(On-Windows), 1)
154-
@if exist lib\chsrc.res del /Q lib\chsrc.res 2>nul
155-
@windres lib\win_res.rc -O coff -o lib\chsrc.res -Iinclude -Ilib
156-
@$(CC) src/chsrc-main.c lib/chsrc.res $(CFLAGS) $(_C_Warning_Flags) -o $(ReleaseMode-Target-Name)
157-
@del /Q lib\chsrc.res 2>nul
154+
@if exist src\\res\\chsrc.res del src\\res\\chsrc.res
155+
@windres src\\res\\win_res.rc -O coff -o src\\res\\chsrc.res -Iinclude -Ilib -Isrc\\framework -Isrc\\res
156+
@$(CC) src\\chsrc-main.c src\\res\\chsrc.res $(CFLAGS) $(_C_Warning_Flags) -o $(ReleaseMode-Target-Name)
157+
@del src\\res\\chsrc.res
158158
else
159159
@$(CC) src/chsrc-main.c $(CFLAGS) $(_C_Warning_Flags) -o $(ReleaseMode-Target-Name)
160160
endif
@@ -164,8 +164,8 @@ endif
164164
build-in-ci-release-mode:
165165
@echo Starting: Build in CI-RELEASE mode: \'$(CC)\' $(CFLAGS) -o $(CIReleaseMode-Target-Name)
166166
ifeq ($(On-Windows), 1)
167-
@windres lib\win_res.rc -O coff -o lib\chsrc.res -Iinclude -Ilib
168-
@$(CC) src/chsrc-main.c lib/chsrc.res $(CFLAGS) $(_C_Warning_Flags) -o $(CIReleaseMode-Target-Name)
167+
@windres src\\res\\win_res.rc -O coff -o src\\res\\chsrc.res -Iinclude -Ilib -Isrc\\framework -Isrc\\res
168+
@$(CC) src\\chsrc-main.c src\\res\\chsrc.res $(CFLAGS) $(_C_Warning_Flags) -o $(CIReleaseMode-Target-Name)
169169
else
170170
@$(CC) src/chsrc-main.c $(CFLAGS) $(_C_Warning_Flags) -o $(CIReleaseMode-Target-Name)
171171
endif

justfile

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ CFLAGS_chk_Clang := if os() == 'windows' {
5353
} else {''}
5454

5555

56-
CFLAGS_base := '-Iinclude -Ilib ' + CFLAGS_chk_Clang
56+
CFLAGS_base := '-Iinclude -Ilib -Isrc/framework ' + CFLAGS_chk_Clang
5757

5858
WARN := '-Wall -Wextra -Wno-unused-variable -Wno-unused-function -Wno-missing-braces -Wno-misleading-indentation' + ' ' + \
5959
'-Wno-missing-field-initializers -Wno-unused-parameter -Wno-sign-compare'
@@ -115,10 +115,10 @@ build-in-debug-mode:
115115

116116
build-in-release-mode:
117117
@echo Starting: Build in RELEASE mode: '{{CC}}' {{CFLAGS_release_mode_prompt}} -o {{ReleaseMode-Target-Name}}
118-
{{ if os() == 'windows' { '@if exist lib\\chsrc.res del lib\\chsrc.res' } else { '' } }}
119-
{{ if os() == 'windows' { '@windres lib\\win_res.rc -O coff -o lib\\chsrc.res -Iinclude -Ilib' } else { '' } }}
120-
{{ 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}}' } }}
121-
{{ if os() == 'windows' { '@del lib\\chsrc.res' } else { '' } }}
118+
{{ if os() == 'windows' { '@if exist src\\res\\chsrc.res del src\\res\\chsrc.res' } else { '' } }}
119+
{{ if os() == 'windows' { '@windres src\\res\\win_res.rc -O coff -o src\\res\\chsrc.res -Iinclude -Ilib -Isrc\\framework -Isrc\\res' } else { '' } }}
120+
{{ 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 } }}
121+
{{ if os() == 'windows' { '@del src\\res\\chsrc.res' } else { '' } }}
122122
@echo Finished: Build in RELEASE mode
123123

124124
debug: build-in-debug-mode

0 commit comments

Comments
 (0)