yeah
This commit is contained in:
+17
-11
@@ -48,10 +48,6 @@ add_project_link_arguments(
|
||||
language: 'c',
|
||||
)
|
||||
|
||||
if target_machine.cpu_family() == 'x86_64'
|
||||
add_project_arguments('-masm=intel', language: 'c')
|
||||
endif
|
||||
|
||||
common_includes = include_directories('include')
|
||||
|
||||
cfg = configuration_data()
|
||||
@@ -60,11 +56,21 @@ cfg.set_quoted('ZINNIA_ARCH', target_machine.cpu_family())
|
||||
cfg.set_quoted('ZINNIA_COMPILER_ID', c_compiler.get_id() + ' ' + c_compiler.version())
|
||||
cfg.set_quoted('ZINNIA_LINKER_ID', c_compiler.get_linker_id())
|
||||
|
||||
# Parse kernel config
|
||||
kv = import('keyval')
|
||||
kconfig = kv.load(get_option('config_path'))
|
||||
foreach k, v : kconfig
|
||||
if v == 'y'
|
||||
cfg.set10(k, true)
|
||||
else
|
||||
cfg.set(k, v)
|
||||
endif
|
||||
endforeach
|
||||
|
||||
kernel_c_args = [
|
||||
'-ffreestanding',
|
||||
'-nostdinc', # We provide our own headers.
|
||||
'-fno-stack-protector',
|
||||
'-fno-omit-frame-pointer',
|
||||
'-fno-pie',
|
||||
]
|
||||
|
||||
@@ -78,14 +84,16 @@ kernel_link_args = [
|
||||
]
|
||||
|
||||
kernel_includes = [
|
||||
include_directories(
|
||||
'arch' / target_machine.cpu_family() / 'include',
|
||||
),
|
||||
include_directories('arch' / target_machine.cpu_family() / 'include'),
|
||||
]
|
||||
|
||||
kernel_sources = []
|
||||
|
||||
configure_file(configuration: cfg, output: 'config.h')
|
||||
configure_file(
|
||||
configuration: cfg,
|
||||
output: 'config.h',
|
||||
depfile: get_option('config_path'),
|
||||
)
|
||||
|
||||
# Goes first so we can add arch-specific flags to drivers.
|
||||
subdir('arch' / target_machine.cpu_family())
|
||||
@@ -105,14 +113,12 @@ executable(
|
||||
include_directories: [
|
||||
common_includes,
|
||||
kernel_includes,
|
||||
uacpi_includes,
|
||||
],
|
||||
c_args: kernel_c_args,
|
||||
link_args: kernel_link_args,
|
||||
link_depends: kernel_lds,
|
||||
sources: [
|
||||
kernel_sources,
|
||||
uacpi_sources,
|
||||
],
|
||||
install: true,
|
||||
install_dir: '/boot',
|
||||
|
||||
Reference in New Issue
Block a user