Unifying External Interrupt System (#51)
[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 ])
34
35 sources({
36     config("arch"): {
37         "x86_64": [
38             "hart64.c",
39             "syscall64.S",
40             "exceptions/interrupt64.S",
41             "boot/x86_64/boot64.S",
42             "boot/x86_64/init64.c",
43             "boot/x86_64/prologue64.S",
44             "boot/x86_64/kremap64.c",
45             "exec/elf64.c"
46         ],
47         "i386": [
48             "hart32.c",
49             "syscall32.S",
50             "exceptions/interrupt32.S",
51             "boot/i386/boot32.S",
52             "boot/i386/init32.c",
53             "boot/i386/prologue32.S",
54             "boot/i386/kremap32.c",
55             "exec/elf32.c"
56         ]
57     }
58 })
59
60 headers([
61     "includes"
62 ])
63
64
65 if config("arch") == "x86_64":
66     compile_opts([
67         "-m64", 
68         "-fno-unwind-tables", 
69         "-fno-asynchronous-unwind-tables",
70         "-mcmodel=large"
71     ])
72     linking_opts([
73         "-m64",
74     ])
75 else:
76     compile_opts("-m32")
77     linking_opts("-m32")
78
79 if not config("x86_enable_sse_feature"):
80     compile_opts("-mno-sse")