-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.rs
72 lines (66 loc) · 1.95 KB
/
build.rs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
use std::process::Command;
fn main() {
// Build Bitnax
cc::Build::new()
.file("src/ext/lz.c")
.warnings(false)
.compile("bitnax");
// Build cc1541
cc::Build::new()
.file("src/ext/cc1541.c")
.warnings(false)
.compile("cc1541");
// Build x65
cc::Build::new()
.cpp(true)
.file("src/ext/x65.cpp")
.warnings(false)
.compile("x65");
// Build Krill's Loader resident object
Command::new("ca65")
.arg("-tc64")
.arg("--cpu")
.arg("6502X")
.arg("-D")
.arg("EXTCONFIGPATH")
.arg("-I")
.arg("./src/c64")
.arg("-I")
.arg("./src/ext/loader-v184/shared")
.arg("-I")
.arg("./src/ext/loader-v184/loader/include")
.arg("-o")
.arg(std::env::var("OUT_DIR").unwrap() + "/resident.o")
.arg("./src/ext/loader-v184/loader/src/resident.s")
.output()
.expect("Failed to build loader resident code");
// Build Krill's Loader install object
Command::new("ca65")
.arg("-tc64")
.arg("--cpu")
.arg("6502X")
.arg("-D")
.arg("EXTCONFIGPATH")
.arg("-I")
.arg("./src/c64")
.arg("-I")
.arg("./src/ext/loader-v184/shared")
.arg("-I")
.arg("./src/ext/loader-v184/loader/include")
.arg("-o")
.arg(std::env::var("OUT_DIR").unwrap() + "/install.o")
.arg("./src/ext/loader-v184/loader/src/install.s")
.output()
.expect("Failed to build loader install code");
// Link Krill's Loader
Command::new("cl65")
.arg("-C")
.arg("./src/c64/linker.cfg")
.arg("-o")
.arg(std::env::var("OUT_DIR").unwrap() + "/loader")
.arg(std::env::var("OUT_DIR").unwrap() + "/resident.o")
.arg(std::env::var("OUT_DIR").unwrap() + "/install.o")
.arg("c64.lib")
.output()
.expect("Failed to link loader");
}