add windows build process
This commit is contained in:
parent
6900dadd9e
commit
da12e8519e
3 changed files with 25 additions and 7 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -1,3 +1,4 @@
|
||||||
/target
|
/target
|
||||||
/user
|
/user
|
||||||
*.zip
|
*.zip
|
||||||
|
version.txt
|
||||||
|
|
25
Makefile
25
Makefile
|
@ -1,11 +1,22 @@
|
||||||
|
|
||||||
release_name = marble_machinations
|
VERSION = `cat version.txt`
|
||||||
bin_name = marble2
|
RELEASE_DIRNAME = marble_machinations_${VERSION}
|
||||||
|
BIN_NAME = marble-machinations
|
||||||
|
|
||||||
|
TARGET_W64 = x86_64-pc-windows-gnu
|
||||||
|
|
||||||
linux:
|
linux:
|
||||||
cargo build --release
|
cargo build --release
|
||||||
mkdir ${release_name}
|
mkdir ${RELEASE_DIRNAME}
|
||||||
cp target/release/${bin_name} ${release_name}/
|
cp target/release/${BIN_NAME} ${RELEASE_DIRNAME}/
|
||||||
cp -r assets levels ${release_name}/
|
cp -r assets levels ${RELEASE_DIRNAME}/
|
||||||
zip -r ${release_name}_linux.zip ${release_name}/
|
zip -r ${RELEASE_DIRNAME}_linux.zip ${RELEASE_DIRNAME}/
|
||||||
rm -rf ${release_name}
|
rm -rf ${RELEASE_DIRNAME}
|
||||||
|
|
||||||
|
windows:
|
||||||
|
cargo build --release --target=${TARGET_W64}
|
||||||
|
mkdir ${RELEASE_DIRNAME}_win
|
||||||
|
cp target/${TARGET_W64}/release/${BIN_NAME}.exe ${RELEASE_DIRNAME}_win/
|
||||||
|
cp -r assets levels ${RELEASE_DIRNAME}_win/
|
||||||
|
zip -r ${RELEASE_DIRNAME}_win.zip ${RELEASE_DIRNAME}_win/
|
||||||
|
rm -rf ${RELEASE_DIRNAME}_win
|
||||||
|
|
6
build.rs
Normal file
6
build.rs
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
use std::{fs::File, io::Write};
|
||||||
|
|
||||||
|
fn main(){
|
||||||
|
let version = concat!("v", env!("CARGO_PKG_VERSION"));
|
||||||
|
File::create("version.txt").unwrap().write_all(version.as_bytes()).unwrap();
|
||||||
|
}
|
Loading…
Reference in a new issue