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')