use std::env;
use std::process::{Command, exit};
fn main() -> Result<(), Box<dyn std::error::Error>> {
let out_dir = env::var("OUT_DIR")?;
let mut handler_nasm_true = Command::new("nasm").args([
"-f", "elf",
"src/asm/true.asm",
"-o", &(out_dir.clone() + "/true.o")
]).spawn()?;
let mut handler_nasm_false = Command::new("nasm").args([
"src/asm/false.asm",
"-o", &(out_dir.clone() + "/false.o")
if !handler_nasm_true.wait_with_output()?.stderr.is_empty() {
exit(1);
}
let mut handler_ld_true = Command::new("ld").args([
"-m", "elf_i386",
"-s",
&(out_dir.clone() + "/true.o"),
"-o", &(out_dir.clone() + "/true"),
if !handler_nasm_false.wait_with_output()?.stderr.is_empty() {
exit(1)
let mut handler_ld_false = Command::new("ld").args([
&(out_dir.clone() + "/false.o"),
"-o", &(out_dir.clone() + "/false"),
handler_ld_true.wait();
handler_ld_false.wait();
Ok(())