尧图网络科技YAOTU DIGITAL 获取报价
获取报价
首页 / 资讯中心 / 文章详情

SJX Make,纯C实现的智能make程序,无需makefile脚本,全自动,适合c项目

发布时间:2026/9/27 9:56:35

资讯中心
01
ARTICLE

SJX Make,纯C实现的智能make程序,无需makefile脚本,全自动,适合c项目

SJX Make,纯C实现的智能make程序,无需makefile脚本,全自动,适合c项目
之前发布的纯c单h文件make系统 https://github.com/shajunxing/sjx-make/blob/main/make.h.md ,依旧需要在项目源文件每次变更后调整编译脚本太麻烦。于是我一怒之下用400行代码完成了“一次编写处处运行”自动分析头文件依赖关系自动增量、并行编译。约定项目目录结构是这样的项目名 -- src所有源代码头文件都平铺在src里不再分子目录当然也可以有子目录但我比较懒自己的项目都很简单。执行smake会编译所有c文件然后把所有不带main函数的合并为库文件默认名字同项目名。所有带main函数的各自单独生成同名可执行程序。编译后的目录如下项目名 -- bin 所有可执行程序和库文件 -- src -- tmp 中间过程产生的其它文件比如目标文件编译支持调试和发布模式支持动态也就是生成动态库.dll .so和静态链接支持windows和posix兼容系统。想玩的可以在 https://github.com/shajunxing/sjx-make/releases 下载 windows 可执行程序。命令行参数如下C:\smake --help Usage: smake [clean|debug|release|mono|static|dynamic|-h|--help] clean cleanup generated binaries debug with debug symbols release no debug symbols, optimize for speed mono generate monolithic .exe static static build, link with dynamic crt dynamic seperate to .dll .exe, link with dynamic crt Default is: release static -h, --help show help More options can be set in makefile, see examples.同时也支持简单的配置文件为了方便编辑器语法高亮也取名为makefile格式如下# 开头的是注释行# Configuration file for SJX Smart Make System. # Values shown below are default values. # Build mode, d is with debug symbols, r is no debug symbols and optimize for speed # buildr # Linking model, m is all static, s static project and dynamic crt, d is all dynamic # linkages # Pattern to match main function # main_patint main( # Lib and dll name, default is project folder name # lib_name # Extra options for linker # ex_opts_windows # ex_opts_posix # GetUserNameA requires advapi32.lib ex_opts_windowsuser32.lib gdi32.lib imm32.lib advapi32.lib winmm.lib # suppress fucking stupid readline warnings Using xxx in statically linked applications requires at runtime the shared libraries ... ex_opts_posix-lm -lreadline -lncurses -ltinfo -Wl,--no-warnings
02
RELATED NEWS

相关资讯

更多网站建设与数字化升级内容

03
WHY YAOTU

想打造同款高转化官网?

懂行业、懂生意,从建站到增长一站式陪跑

◈

场景化定制

不做模板站,围绕你的业务场景量身设计,小众不撞款。

◐

营销型架构

以转化目标组织内容与路径,让官网真正带来询盘。

▲

全周期服务

设计、开发、运营、运维一体,上线只是开始。

免费获取你的建站方案

留下需求,专属顾问 24 小时内为你输出方案建议。