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