File tree Expand file tree Collapse file tree 4 files changed +22
-1
lines changed
Expand file tree Collapse file tree 4 files changed +22
-1
lines changed File renamed without changes.
Original file line number Diff line number Diff line change 1+ use std:: env;
2+ use std:: fs:: File ;
3+ use std:: io:: Write ;
4+ use std:: path:: PathBuf ;
5+
6+ fn main ( ) {
7+ // Put `neotron-cortex-m.ld` in our output directory and ensure it's
8+ // on the linker search path.
9+ let out = & PathBuf :: from ( env:: var_os ( "OUT_DIR" ) . unwrap ( ) ) ;
10+ File :: create ( out. join ( "neotron-cortex-m.ld" ) )
11+ . unwrap ( )
12+ . write_all ( include_bytes ! ( "../neotron-cortex-m.ld" ) )
13+ . unwrap ( ) ;
14+ println ! ( "cargo:rustc-link-search={}" , out. display( ) ) ;
15+
16+ // By default, Cargo will re-run a build script whenever
17+ // any file in the project changes. By specifying `neotron-cortex-m.ld`
18+ // here, we ensure the build script is only re-run when
19+ // `neotron-cortex-m.ld` is changed.
20+ println ! ( "cargo:rerun-if-changed=neotron-cortex-m.ld" ) ;
21+ }
Original file line number Diff line number Diff line change 44extern crate neotron_sdk;
55
66#[ no_mangle]
7- extern "C" fn main ( ) -> i32 {
7+ extern "C" fn neotron_main ( ) -> i32 {
88 let stdout = neotron_sdk:: stdout ( ) ;
99 stdout. write ( b"Hello, world\n " ) . unwrap ( ) ;
1010 0
File renamed without changes.
You can’t perform that action at this time.
0 commit comments