makefile update

This commit is contained in:
MeexReay 2025-04-19 11:34:32 +03:00
parent 123b750e78
commit d8170d10e5
2 changed files with 27 additions and 15 deletions

View File

@ -1,19 +1,27 @@
build-windows:
.PHONY: clean build
build: build/windows-x86_64 build/linux-x86_64
build/windows-x86_64:
mkdir -p build
mkdir -p build/windows-x86_64
# cargo build -r --target x86_64-pc-windows-gnu
# cp target/x86_64-pc-windows-gnu/release/bRAC
mkdir -p $@
cargo build -r --target x86_64-pc-windows-gnu
cp target/x86_64-pc-windows-gnu/release/bRAC $@/bin
curl -s https://api.github.com/repos/wingtk/gvsbuild/releases/latest \
| grep -o ".*browser_download_url.*GTK4_Gvsbuild.*_x64.zip.*" \
| cut -d : -f 2,3 \
| tr -d \" \
| wget -O build/windows-x86_64/gtk4.zip -qi -
unzip build/windows-x86_64/gtk4.zip -d build/windows-x86_64
rm build/windows-x86_64/gtk4.zip
echo 'Set oWS = WScript.CreateObject("WScript.Shell")' > build/windows-x86_64/gen_link.vbs
echo 'Set oLink = oWS.CreateShortcut("build/windows-x86_64/bRAC.lnk")' >> build/windows-x86_64/gen_link.vbs
echo 'oLink.TargetPath = "bin\\bRAC.exe"' >> build/windows-x86_64/gen_link.vbs
echo 'oLink.Description = "Relative shortcut to bin\\myapp.exe"' >> build/windows-x86_64/gen_link.vbs
echo 'oLink.Save' >> build/windows-x86_64/gen_link.vbs
wine wscript.exe build/windows-x86_64/gen_link.vbs
rm build/windows-x86_64/gen_link.vbs
| wget -O $@/gtk4.zip -qi -
unzip $@/gtk4.zip -d $@
rm $@/gtk4.zip
mv $@/bin/* b$@/
rm $@/bin
build/linux-x86_64:
mkdir -p build
mkdir -p $@
cargo build -r --target x86_64-unknown-linux-gnu
cp target/x86_64-pc-windows-gnu/release/bRAC $@
clean:
rm -r build

View File

@ -8,4 +8,8 @@ on Nix:
nix-shell -p pkgsCross.mingwW64.stdenv.cc pkgsCross.mingwW64.windows.pthreads pkgsCross.mingwW64.gtk4
```
##
## Build
```bash
build build/windows-x86_64
```