metal-cos/sys/SConscript
2014-06-30 15:52:35 -07:00

43 lines
863 B
Python

import sys
Import('env')
kern_env = env.Clone()
src = [ ]
src_amd64 = [
# Multiboot requires multiboot.S to be the first file
"amd64/multiboot.S",
"amd64/mbentry.c",
# AMD64
"amd64/trap.c",
"amd64/trapentry.S",
"amd64/machine.c",
"amd64/pci.c",
"amd64/pmap.c",
"amd64/lapic.c",
"amd64/ioapic.c",
"dev/x86/vgacons.c",
"dev/ahci.c",
]
src_common = [
"kern/libc.c",
"kern/palloc.c",
"kern/printf.c",
]
if (env["ARCH"] == "amd64"):
src.append(src_amd64)
src.append(src_common)
kern_env.Append(LINKFLAGS = ['-N', '-nostdlib'])
kern_env.Append(CPPFLAGS = ['-ffreestanding', '-fno-builtin', '-nostdinc',
'-mno-red-zone', '-mcmodel=kernel'])
# '-target', 'amd64-orion-eabi'
kern_env.Append(CPPPATH = ['#include', '#sys/include'])
kern_env.Program("castor", src)