summaryrefslogtreecommitdiff
path: root/meson.build
blob: fd270f00b7b2f33505e8898d30c33c34fd7d8fad (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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
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')