aboutsummaryrefslogtreecommitdiff
path: root/meson.build
blob: d0f68195ac8c5977c75f19f98455dab5181cf6a1 (plain)
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
project('glitch kernel', 'c', version: '0.1.0', default_options: ['c_std=gnu11', 'warning_level=2'])
python3 = import('python').find_installation('python3')

subdir('arch/i686')
subdir('devices')

kernel = executable('glitch.elf',
  ['src/multiboot2.c', 'src/mmap.c', 'src/kernel.c',
   'src/isr.c', 'src/mem/vmm.c',
   'lib/string/itoa.c', 'lib/stdio/printf.c'],
  link_language: 'c',
  link_args: ['-ffreestanding', '-nostdlib', '-static', '-T', meson.current_source_dir()/'arch/i686/linker.ld'],
  install: true, native: false,
  include_directories: [
    include_directories('grub/include', is_system: true),
    include_directories('lib')
  ],
  dependencies: [arch, devices]
)

glitch_iso = custom_target('glitch.iso',
  input: 'scripts/mkiso.py', output: 'glitch.iso', depends: [kernel],
  command: [python3, '@INPUT@', kernel, '@SOURCE_ROOT@/grub/grub.cfg'])

qemu = find_program('qemu-system-i386')
run_target('run', depends: glitch_iso, command: [qemu, '-cdrom', 'glitch.iso', '-accel', 'kvm'])