Make shell script tools more portable
[helenos.git] / meson.build
blobfedbd474317ad484703b30fa5603cc10c5997f9a
1 # TODO: Use vcs_tag() to generate version string
2 # TODO: jobfile
3 # TODO: lto in uspace
4 # TODO: fix clang build
6 project(
7     'HelenOS',
8     [ 'c', 'cpp' ],
9     default_options : ['buildtype=plain', 'c_std=gnu11', 'cpp_std=c++17', 'warning_level=3', 'werror=false', 'b_staticpic=false', 'prefix=/' ],
10     meson_version: '>=0.50.1',
13 debug_options = false
14 debug_shell_scripts = false
16 subdir('meson/part/tools')
17 subdir('meson/part/read_config')
18 subdir('meson/part/compiler_args')
19 subdir('meson/part/initrd_manifest')
20 subdir('meson' / 'arch' / UARCH)
22 ## The at-sign
24 # The `atsign` variable holds the ASCII character representing the at-sign
25 # ('@') used in various $(AS) constructs (e.g. @progbits). On architectures that
26 # don't use '@' for starting a comment, `atsign` is merely '@'. However, on
27 # those that do use it for starting a comment (e.g. arm32), `atsign` must be
28 # defined as the percentile-sign ('%') in the architecture-dependent files.
30 if not is_variable('atsign')
31         atsign = '@'
32 endif
34 ## Some architectures need a particular string at the beginning of assembly files.
35 if not is_variable('kernel_as_prolog')
36         kernel_as_prolog = ''
37 endif
38 if not is_variable('uspace_as_prolog')
39         uspace_as_prolog = ''
40 endif
42 # The following variables are filled in by code in the kernel and uspace subdirs.
44 # References to the actual binary artefacts that will be part of initrd image.
45 rd_init_binaries = []
46 # Installed files.
47 install_files = []
48 install_deps = []
49 # Install script for headers.
50 # TODO: Make a list of directories and turn into script later.
51 uspace_lib_install_script_text = []
53 subdir('kernel')
54 subdir('uspace')
56 subdir('meson/part/exports')
57 subdir('meson/part/initrd')
59 subdir('boot')
61 # Copy the final image to the build root,
62 # and write its name to a text file `image_path`.
64 if is_variable('POST_INPUT')
65         image = custom_target(POST_OUTPUT,
66                 output: POST_OUTPUT,
67                 input: POST_INPUT,
68                 command: [ cp, '@INPUT@', '@OUTPUT@' ],
69         )
71         custom_target('image_path',
72                 output: 'image_path',
73                 input: image,
74                 command: [ 'echo', '@INPUT@' ],
75                 capture: true,
76         )
77 else
78         custom_target('image_path',
79                 output: 'image_path',
80                 command: [ 'echo' ],
81                 capture: true,
82         )
83 endif
85 subdir('meson/part/extra_targets')