You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

62 lines
1.4 KiB

project('x86os', [ 'c', 'rust' ])
## Find required programs
nasm = find_program('nasm', required: true)
cargo = find_program('cargo', required: true)
sh = find_program('sh', required: true)
## Assembly source files, NASM syntax
src_asm = [
'src/start.S'
]
## Generator used to generate object files from all the assembly
asm_compiler = generator(
nasm
, output : [ '@BASENAME@.o' ]
, arguments : [ '-f', 'elf', '@INPUT@', '-o', '@OUTPUT@' ]
)
## Compiled assembly object files
compiled_asm = asm_compiler.process(src_asm)
cargo_args = []
if get_option('release')
cargo_args += '--release'
endif
rust_lib = custom_target(
'x86os-rust'
, output: 'libx86os.a' # target/i386-unknown-none/debug/
, command:
[ cargo, 'build', '--color', 'always', '-Zunstable-options', '--out-dir', '@OUTDIR@' ] + cargo_args
, input:
[ 'Cargo.toml'
, 'Cargo.lock'
, 'src/gdt/access.rs'
, 'src/gdt/entry.rs'
, 'src/gdt/granularity.rs'
, 'src/gdt/mod.rs'
, 'src/idt/access.rs'
, 'src/idt/entry.rs'
, 'src/idt/mod.rs'
, 'src/rlibc/memory.rs'
, 'src/rlibc/spin_lock.rs'
, 'src/rlibc/mod.rs'
, 'src/screen/mod.rs'
, 'src/lib.rs'
, 'src/limited_pointer.rs'
, 'src/ring.rs'
]
)
kernel = executable(
'x86os'
, compiled_asm
, link_args: [ '-Wl,-T../ld/linker.ld', '-Wl,-melf_i386' ]
, link_depends: [ 'ld/linker.ld' ]
, link_with: [ rust_lib ]
, link_language: 'c'
)
# include_directories: 'src',