7d50ca31978b9d28f2ea45e9bb488814b02af6e7
[lunaix-os.git] / lunaix-os / arch / x86 / LBuild
1 use("hal")
2
3 sources([
4     "exceptions/interrupts.c",
5     "exceptions/isrdef.c",
6     "exceptions/intr_routines.c",
7     "exceptions/isrm.c",
8     "exceptions/intrhnds.S",
9 ])
10
11 sources([
12     "boot/mb_parser.c",
13     "boot/kpt_setup.c",
14     "boot/boot_helper.c"
15 ])
16
17 sources([
18     "mm/fault.c",
19     "mm/tlb.c",
20     "mm/pmm.c",
21     "mm/gdt.c",
22     "mm/vmutils.c"
23 ])
24
25 sources([
26     "klib/fast_crc.c",
27     "klib/fast_str.c",
28     "exec/exec.c",
29     "hart.c",
30     "arch.c",
31     "gdbstub.c",
32     "trace.c",
33     "hart.c",
34     "failsafe.S"
35 ])
36
37 sources({
38     config("arch"): {
39         "x86_64": [
40             "hart64.c",
41             "syscall64.S",
42             "exceptions/interrupt64.S",
43             "boot/x86_64/boot64.S",
44             "boot/x86_64/init64.c",
45             "boot/x86_64/prologue64.S",
46             "boot/x86_64/kremap64.c",
47             "exec/elf64.c"
48         ],
49         "i386": [
50             "hart32.c",
51             "syscall32.S",
52             "exceptions/interrupt32.S",
53             "boot/i386/boot32.S",
54             "boot/i386/init32.c",
55             "boot/i386/prologue32.S",
56             "boot/i386/kremap32.c",
57             "exec/elf32.c"
58         ]
59     }
60 })
61
62 headers([
63     "includes"
64 ])
65
66
67 if config("arch") == "x86_64":
68     compile_opts([
69         "-m64", 
70         "-fno-unwind-tables", 
71         "-fno-asynchronous-unwind-tables",
72         "-mcmodel=large"
73     ])
74     linking_opts([
75         "-m64",
76     ])
77 else:
78     compile_opts("-m32")
79     linking_opts("-m32")
80
81 if not config("x86_enable_sse_feature"):
82     compile_opts("-mno-sse")