started working on build system

This commit is contained in:
2026-02-05 03:12:44 +00:00
parent e69514e46e
commit 1fcfb3120b
4 changed files with 251 additions and 1 deletions
+17
View File
@@ -24,5 +24,22 @@ pub mod prelude {
pub use crate::tooling::project;
}
use std::path::Path;
use num_cpus as _;
use threadpool as _;
use crate::prelude::CompilerEngine;
pub fn assemble_file(input: &str, output: &str) -> Result<(), std::io::Error> {
let mut engine = CompilerEngine::new();
engine.start_compilation(Path::new(input));
let result = engine.wait_for_result().unwrap();
for instruction in result {
if let Err(e) = std::fs::write(output, instruction.encode().to_be_bytes()) {
eprintln!("Failed to write to output file: {e}");
std::process::exit(1);
}
}
Ok(())
}