1 Star 0 Fork 32

王泊钧/rust-Melon

forked from xiaoyuanzi914/rust-Melon 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
build.bat 1.68 KB
一键复制 编辑 原始数据 按行查看 历史
xiaoyuanzi914 提交于 2025-01-09 14:32 . Initial commit
@echo off
set "HOME=%HOMEDRIVE%%HOMEPATH%"
echo Installation Path: [%HOME%/libmelon]
echo Generating files and directories ...
setlocal enabledelayedexpansion
set "old=MLN_ROOT"
set "new=!%HOME%!\libmelon"
set "new=%new:\=\\%"
set "file=src/mln_path.c"
powershell -Command "(Get-Content '%file%') -replace '%old%', '\"%new%\"' | Set-Content '%file%'"
set "old=MLN_NULL"
set "new=!%HOME%!\libmelon\null"
set "new=%new:\=\\%"
set "file=src/mln_path.c"
powershell -Command "(Get-Content '%file%') -replace '%old%', '\"%new%\"' | Set-Content '%file%'"
set "old=MLN_LANG_LIB"
set "new=!%HOME%!\libmelon\lang\lib"
set "new=%new:\=\\%"
set "file=src/mln_path.c"
powershell -Command "(Get-Content '%file%') -replace '%old%', '\"%new%\"' | Set-Content '%file%'"
set "old=MLN_LANG_DYLIB"
set "new=!%HOME%!\libmelon\lang\dylib"
set "new=%new:\=\\%"
set "file=src/mln_path.c"
powershell -Command "(Get-Content '%file%') -replace '%old%', '\"%new%\"' | Set-Content '%file%'"
set "old={{ROOT}}"
set "new=!%HOME%!\libmelon"
set "new=%new:\=\\%"
set "file=conf/melon.conf.msvc.template"
powershell -Command "(Get-Content '%file%') -replace '%old%', '%new%' | Set-Content 'conf/melon.conf'"
endlocal
mkdir lib objs\src "%HOME%\libmelon\logs" "%HOME%\libmelon\lang\lib" "%HOME%\libmelon\lang\dylib" "%HOME%\libmelon\include" "%HOME%\libmelon\conf" "%HOME%\libmelon\lib" "%HOME%\libmelon\tmp"
echo "" > "%HOME%\libmelon\null"
for %%f in (src\*.c) do (
cl /c /DMSVC /I include "%%f" /Fo:objs\%%f.o /O2
)
lib /OUT:lib\libmelon_static.lib objs\src\*.o
setlocal
xcopy include "%HOME%/libmelon/include" /E /I /Y
xcopy lib "%HOME%/libmelon/lib" /E /I /Y
xcopy conf "%HOME%/libmelon/conf" /E /I /Y
endlocal
echo Done
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Rust
1
https://gitee.com/bo-jun-wang/rust-Melon.git
[email protected]:bo-jun-wang/rust-Melon.git
bo-jun-wang
rust-Melon
rust-Melon
main

搜索帮助