Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
*.dll
*.out
*.exe

*.res


##############################
Expand Down
6 changes: 3 additions & 3 deletions doc/01-开发与构建.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
! -------------------------------------------------------------
! Doc Type : Markdown
! Doc Name : 01-开发与构建.md
! Doc Authors : 曾奥然 <ccmywish@qq.com>
! Contributors : Nul None <nul@none.org>
! Doc Authors : 曾奥然 <ccmywish@qq.com>
! Contributors : Mikachu2333 <mikachu.23333@zohomail.com>
! |
! Created On : <2024-12-27>
! Last Modified : <2025-08-22>
! Last Modified : <2025-10-11>
! ---------------------------------------------------------- -->

# 开发 chsrc
Expand Down
9 changes: 9 additions & 0 deletions doc/image/chsrc.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
19 changes: 11 additions & 8 deletions justfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
# SPDX-License-Identifier: GPL-3.0-or-later
# --------------------------------------------------------------
# Build File : justfile
# File Authors : Aoran Zeng <ccmywish@qq.com>
# Contributors : Nul None <nul@none.org>
# File Authors : Aoran Zeng <ccmywish@qq.com>
# Contributors : Mikachu2333 <mikachu.23333@zohomail.com>
# |
# Created On : <2025-06-18>
# Last Modified : <2025-07-21>
# Last Modified : <2025-10-11>
#
# 该文件主要用于在原生Windows上执行项目的基本任务,而不借助于
# GNU make 以及相应的 MSYS2、Cygwin 环境
Expand Down Expand Up @@ -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'
Expand Down Expand Up @@ -104,9 +104,9 @@ alias c := clean
default: build-in-dev-mode

build-in-dev-mode:
@echo Starting: Build in DEV mode: '{{CC}}' {{CFLAGS_dev_mode_prompt}} -o {{DevMode-Target-Name}}
@{{CC}} src/chsrc-main.c {{CFLAGS_dev_mode}} -o {{DevMode-Target-Name}}
@echo Finished: Build in DEV mode
@echo Starting: Build in DEV mode: '{{CC}}' {{CFLAGS_dev_mode_prompt}} -o {{DevMode-Target-Name}}
@{{CC}} src/chsrc-main.c {{CFLAGS_dev_mode}} -o {{DevMode-Target-Name}}
@echo Finished: Build in DEV mode

build-in-debug-mode:
@echo Starting: Build in DEBUG mode: '{{CC}}' {{CFLAGS_debug_mode_prompt}} -o {{DebugMode-Target-Name}}
Expand All @@ -115,7 +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}}
@{{CC}} src/chsrc-main.c {{CFLAGS_release_mode}} -o {{ReleaseMode-Target-Name}}
{{ 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
Expand Down
4 changes: 2 additions & 2 deletions src/chsrc-main.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@
* 然的加入,逐渐成长为互相支持的伙伴。
* ------------------------------------------------------------*/

#define Chsrc_Version "0.2.3"
#define Chsrc_Release_Date "2025/10/06"
#include "version.h"

#define Chsrc_Maintain_URL "https://github.com/RubyMetric/chsrc"
#define Chsrc_Maintain_URL2 "https://gitee.com/RubyMetric/chsrc"

Expand Down
23 changes: 23 additions & 0 deletions src/framework/version.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
/** ------------------------------------------------------------
* Copyright © 2023-2025 曾奥然, 郭恒
* SPDX-License-Identifier: MIT
* -------------------------------------------------------------
* Lib Authors : 曾奥然 <ccmywish@qq.com>
* Contributors : Mikachu2333 <mikachu.23333@zohomail.com>
* |
* Created On : <2025-10-10>
* Last Modified : <2025-10-10>

* !!!警告!!!
* 发布前请修改此处的内容
* ------------------------------------------------------------*/

#define Chsrc_Version "0.2.3"
#define Chsrc_Release_Date "2025/10/06"

// 以下宏仅用于 Windows
#if defined(_WIN32) || defined(_WIN64) || defined(__CYGWIN__)
#define CHSRC_VERSION_MAJOR 0
#define CHSRC_VERSION_MINOR 2
#define CHSRC_VERSION_PATCH 3
#endif
Binary file added src/res/logo.ico
Binary file not shown.
44 changes: 44 additions & 0 deletions src/res/win_res.rc
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
// chsrc.rc - Windows Resource Script
// SPDX-License-Identifier: GPL-3.0-or-later

#include <windows.h>
#include "version.h"

// 图标资源
IDI_ICON1 ICON DISCARDABLE "logo.ico"

// 版本信息
VS_VERSION_INFO VERSIONINFO
FILEVERSION CHSRC_VERSION_MAJOR,CHSRC_VERSION_MINOR,CHSRC_VERSION_PATCH,0
PRODUCTVERSION CHSRC_VERSION_MAJOR,CHSRC_VERSION_MINOR,CHSRC_VERSION_PATCH,0
FILEFLAGSMASK VS_FFI_FILEFLAGSMASK
#ifdef _DEBUG
FILEFLAGS VS_FF_DEBUG
#else
FILEFLAGS 0x0L
#endif
FILEOS VOS_NT_WINDOWS32
FILETYPE VFT_APP
FILESUBTYPE VFT2_UNKNOWN
BEGIN
BLOCK "StringFileInfo"
BEGIN
BLOCK "040904b0"
BEGIN
VALUE "CompanyName", "Github RubyMetric"
VALUE "FileDescription", "Change Source everywhere for every software"
VALUE "FileVersion", Chsrc_Version
VALUE "InternalName", "chsrc"
VALUE "LegalCopyright", "Copyright (c) 2023-2025 RubyMetric"
VALUE "OriginalFilename", "chsrc.exe"
VALUE "ProductName", "chsrc"
VALUE "ProductVersion", Chsrc_Release_Date
VALUE "Comments", "MIT License"
VALUE "LegalTrademarks", ""
END
END
BLOCK "VarFileInfo"
BEGIN
VALUE "Translation", 0x0804, 1200, 0x0409, 1200 // 简体中文和英语
END
END