source: mainline/meson/part/initrd/meson.build@ eb9c598

lfn serial ticket/834-toolchain-update topic/msim-upgrade topic/simplify-dev-export
Last change on this file since eb9c598 was 200b2113, checked in by Jiří Zárevúcky <zarevucky.jiri@…>, 6 years ago

Reorganize main meson.build script

I split most of it into separate subdirs, so that the overall organization
is easier to follow.

  • Property mode set to 100644
File size: 1.8 KB
Line 
1if CONFIG_DEVEL_FILES
2 # If devel files are requested, we have to install libgcc.
3 # We have to explicitly use gcc for this, because clang only prints
4 # file name instead of whole path.
5 libgcc = run_command(cc_arch + '-helenos-gcc',
6 arch_uspace_c_args, '-print-libgcc-file-name',
7 check: true,
8 ).stdout().strip()
9
10 install_files += [[ 'lib', libgcc, 'libgcc.a' ]]
11 install_deps += [ files(libgcc) ]
12endif
13
14# Emit the install script.
15
16install_script_text = []
17
18# Copy uspace/dist.
19_uspace = meson.current_source_dir() / 'uspace'
20install_script_text += 'cp -r -L -T -u "@0@/dist" "${DESTDIR}"'.format(_uspace)
21
22# Copy uspace/overlay
23install_script_text += 'if ls @0@/overlay/* >/dev/null 2>/dev/null; then'.format(_uspace)
24install_script_text += 'cp -r -L @0@/overlay/* "${DESTDIR}"'.format(_uspace)
25install_script_text += 'fi'
26
27
28foreach f : install_files
29 _cmd = 'mkdir -p "${DESTDIR}@0@" && cp -L -T "@1@" "${DESTDIR}@0@/@2@"'
30 install_script_text += _cmd.format(f[0], f[1], f[2])
31endforeach
32
33install_script_text += uspace_lib_install_script_text
34
35install_script = configure_file(
36 configuration: { 'text' : '\n'.join(install_script_text) },
37 input: 'install.sh.in',
38 output: 'install.sh',
39)
40
41# Build up dist
42
43dist_dir = meson.current_build_dir()/'dist/'
44
45dist = custom_target('DIST',
46 output: 'dist.tag',
47 input: [ install_script, install_deps ],
48 command: [ sh, '@INPUT0@', '@OUTPUT@', dist_dir ],
49)
50
51# Build initrd image
52
53if RDFMT == 'tmpfs'
54 initrd_cmd = [ 'tar', '-c', '-f', '@OUTPUT@', '-C', dist_dir, '.' ]
55elif RDFMT == 'fat'
56 initrd_cmd = [ mkfat, '1048576', dist_dir, '@OUTPUT@' ]
57elif RDFMT == 'ext4fs'
58 initrd_cmd = [ mkext4, '1048576', dist_dir, '@OUTPUT@' ]
59else
60 error('Unknown RDFMT: ' + RDFMT)
61endif
62
63initrd_img = custom_target('initrd.img',
64 output: 'initrd.img',
65 input: dist,
66 command: initrd_cmd,
67)
68
69rd_init_binaries += [[ initrd_img, 'boot/initrd.img' ]]
Note: See TracBrowser for help on using the repository browser.