From df70bd8dcb23aa580339fc8e2cef14de1ee8afd5 Mon Sep 17 00:00:00 2001 From: Yifan Wu Date: Sat, 2 Jan 2021 10:15:59 +0800 Subject: [PATCH] Update format of link_user.S --- os/build.rs | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/os/build.rs b/os/build.rs index eb553e5b..88a964b2 100644 --- a/os/build.rs +++ b/os/build.rs @@ -2,7 +2,8 @@ use std::io::{Result, Write}; use std::fs::{File, read_dir}; fn main() { - println!("cargo:rerun-if-changed=../user/src/bin/"); + println!("cargo:rerun-if-changed=../user/src/"); + println!("cargo:rerun-if-changed={}", TARGET_PATH); insert_app_data().unwrap(); } @@ -26,17 +27,12 @@ fn insert_app_data() -> Result<()> { .section .data .global _num_app _num_app: - .quad {} - "#, apps.len())?; + .quad {}"#, apps.len())?; for i in 0..apps.len() { - writeln!(f, r#" - .quad app_{}_start - "#, i)?; + writeln!(f, r#" .quad app_{}_start"#, i)?; } - writeln!(f, r#" - .quad app_{}_end - "#, apps.len() - 1)?; + writeln!(f, r#" .quad app_{}_end"#, apps.len() - 1)?; for (idx, app) in apps.iter().enumerate() { println!("app_{}: {}", idx, app); @@ -46,8 +42,7 @@ _num_app: .global app_{0}_end app_{0}_start: .incbin "{2}{1}.bin" -app_{0}_end: - "#, idx, app, TARGET_PATH)?; +app_{0}_end:"#, idx, app, TARGET_PATH)?; } Ok(()) } \ No newline at end of file