git://scm.lunaixsky.com
/
lunaix-os.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Rewrite the lunabuild toolchain with enhanced feature (#60)
[lunaix-os.git]
/
lunaix-os
/
arch
/
x86
/
LBuild
diff --git
a/lunaix-os/arch/x86/LBuild
b/lunaix-os/arch/x86/LBuild
index ed4b4f8ac9e10f4396fbd1b7b9f0470f311ce447..cd3432807938f3c9a338b341084119712ce206ff 100644
(file)
--- a/
lunaix-os/arch/x86/LBuild
+++ b/
lunaix-os/arch/x86/LBuild
@@
-1,26
+1,26
@@
-use("hal")
+from . import hal
-s
ources([
+s
rc.c += (
"exceptions/interrupts.c",
"exceptions/isrdef.c",
"exceptions/intrhnds.S",
"exceptions/interrupts.c",
"exceptions/isrdef.c",
"exceptions/intrhnds.S",
-
]
)
+)
-s
ources([
+s
rc.c += (
"boot/mb_parser.c",
"boot/kpt_setup.c",
"boot/boot_helper.c",
"boot/mb_parser.c",
"boot/kpt_setup.c",
"boot/boot_helper.c",
-
]
)
+)
-s
ources([
+s
rc.c += (
"mm/fault.c",
"mm/tlb.c",
"mm/pmm.c",
"mm/gdt.c",
"mm/vmutils.c"
"mm/fault.c",
"mm/tlb.c",
"mm/pmm.c",
"mm/gdt.c",
"mm/vmutils.c"
-
]
)
+)
-s
ources([
+s
rc.c += (
"klib/fast_crc.c",
"klib/fast_str.c",
"exec/exec.c",
"klib/fast_crc.c",
"klib/fast_str.c",
"exec/exec.c",
@@
-31,11
+31,11
@@
sources([
"hart.c",
"failsafe.S",
"syscall_lut.S"
"hart.c",
"failsafe.S",
"syscall_lut.S"
-
]
)
+)
-sources({
- c
onfig("arch"): {
- "x86_64": [
+match config.arch:
+ c
ase "x86_64":
+ src.c += (
"hart64.c",
"syscall64.S",
"exceptions/interrupt64.S",
"hart64.c",
"syscall64.S",
"exceptions/interrupt64.S",
@@
-44,8
+44,9
@@
sources({
"boot/x86_64/prologue64.S",
"boot/x86_64/kremap64.c",
"exec/elf64.c"
"boot/x86_64/prologue64.S",
"boot/x86_64/kremap64.c",
"exec/elf64.c"
- ],
- "i386": [
+ )
+ case "i386":
+ src.c += (
"hart32.c",
"syscall32.S",
"exceptions/interrupt32.S",
"hart32.c",
"syscall32.S",
"exceptions/interrupt32.S",
@@
-54,28
+55,21
@@
sources({
"boot/i386/prologue32.S",
"boot/i386/kremap32.c",
"exec/elf32.c"
"boot/i386/prologue32.S",
"boot/i386/kremap32.c",
"exec/elf32.c"
- ]
- }
-})
+ )
-headers([
- "includes"
-])
+src.h += "includes"
-
-if config("arch") == "x86_64":
- compile_opts([
+if config.arch == "x86_64":
+ flag.cc += (
"-m64",
"-fno-unwind-tables",
"-fno-asynchronous-unwind-tables",
"-mcmodel=large"
"-m64",
"-fno-unwind-tables",
"-fno-asynchronous-unwind-tables",
"-mcmodel=large"
- ])
- linking_opts([
- "-m64",
- ])
+ )
+ flag.ld += "-m64"
else:
else:
- compile_opts("-m32")
- linking_opts("-m32")
+ flag.cc += "-m32"
+ flag.ld += "-m32"
-if not config
("x86_enable_sse_feature")
:
- compile_opts("-mno-sse")
\ No newline at end of file
+if not config
.x86_enable_sse_feature
:
+ flag.cc += "-mno-sse"
\ No newline at end of file