-
Notifications
You must be signed in to change notification settings - Fork 1
/
SConstruct
69 lines (61 loc) · 1.54 KB
/
SConstruct
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
import os
env = Environment(
CXX = 'clang++',
CPPFLAGS = [
'-Wall',
'-Wextra',
'-std=c++14',
'-m32',
'-march=i386',
'-nostdlib',
'-nostdinc',
'-ffreestanding',
'-fno-builtin',
'-fno-exceptions',
'-fno-rtti',
'-fno-stack-protector',
],
AS = 'nasm',
ASFLAGS = [
'-felf32',
],
ENV = {
# Allow clang++ to use color.
'TERM': os.environ['TERM']
},
)
# Allow clang static analyzer to override the compiler.
env['CC'] = os.getenv('CC') or env['CC']
env['CXX'] = os.getenv('CXX') or env['CXX']
env['ENV'].update(x for x in os.environ.items() if x[0].startswith('CCC_'))
spideros_exe = env.Program(
target = 'isofs/system/spideros.exe',
source = [
'src/assert.cpp',
'src/boot.asm',
'src/cppsupport.cpp',
'src/display.cpp',
'src/gdt.cpp',
'src/idt.cpp',
'src/interrupts.cpp',
'src/keyboard.cpp',
'src/kmain.cpp',
'src/memory.cpp',
'src/misc.asm',
'src/util.cpp',
],
LINK = 'ld',
LINKFLAGS = [
'-melf_i386',
'-nostdlib',
'-Tlinker.ld',
],
)
Depends(spideros_exe, 'linker.ld')
env.Command('spideros.iso', spideros_exe, 'grub-mkrescue -o $TARGET isofs')
if ARGUMENTS.get('debug') == '1':
env.Append(CPPFLAGS = ['-g'], ASFLAGS = ['-g'])
# Print C++ flags for the YouCompleteMe vim plugin.
if ARGUMENTS.get('ycm'):
print(env.subst('$CXXFLAGS $CCFLAGS $_CCCOMCOM'))
exit()