diff options
| author | Alejandro Sior <aho@sior.be> | 2022-07-23 22:53:47 +0200 |
|---|---|---|
| committer | Alejandro Sior <aho@sior.be> | 2022-07-23 22:53:47 +0200 |
| commit | ef805e9373fd946bf1fe667bf18a54dfed6d1045 (patch) | |
| tree | 7762f9574bbd56c502d4dbba1a9d5f3535035211 /meson.build | |
kernel: add basic modules: arch, mem, rt
Diffstat (limited to 'meson.build')
| -rw-r--r-- | meson.build | 57 |
1 files changed, 57 insertions, 0 deletions
diff --git a/meson.build b/meson.build new file mode 100644 index 0000000..fd270f0 --- /dev/null +++ b/meson.build @@ -0,0 +1,57 @@ +project('kernel', 'c', subproject_dir: 'third') +fs = import('fs') + +kernel_src = [ + 'kernel.c' +] +kernel_link_dep = [] +kernel_link_arg = [] +kernel_inc = [include_directories('.')] +kernel_mod = [] + +# Modules +subdir('rt') +subdir('arch') +subdir('mem') + +kernel = executable('kernel', kernel_src, link_with: kernel_mod, include_directories: kernel_inc, link_args: kernel_link_arg, link_depends: kernel_link_dep) + +# Create the bootable disk file + +boot_bin = subproject('boot').get_variable('boot_bin') +mkboot = subproject('scripts').get_variable('mkboot') +bsfs = subproject('bsfs').get_variable('bsfs') + +embed_files = [ + meson.current_source_dir() / 'boot.ini' +] + +embed_tgt = [ + kernel +] + +mkboot_cmd = [ + mkboot, + bsfs, + '@OUTPUT@', + '@INPUT@' +] + +foreach e : embed_files + mkboot_cmd += e + mkboot_cmd += fs.name(e) +endforeach + +foreach e : embed_tgt + mkboot_cmd += e.full_path() + mkboot_cmd += fs.name(e.full_path()) +endforeach + +boot_fs = custom_target('boot.fs', + output: 'boot.fs', + input: boot_bin, + command: mkboot_cmd, + depend_files: embed_files, + depends: [mkboot, bsfs, embed_tgt], + install: true, + install_dir: 'subdir')
\ No newline at end of file |
