summaryrefslogtreecommitdiff
path: root/fw/app/meson.build
blob: 6665fe462811a342e6d6a3e62c2b236a15c2838c (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
58
59
60
external_project = import('unstable-external_project')

application_source = meson.current_source_dir()

external_project.add_project(
  configure_zephyr,
  configure_options: [
    '--source-tree', application_source,
    '--build-tree', meson.current_build_dir() / 'build',
    '--board', board,
    '--zephyr-base', zephyr,
    '--zephyr-modules', ';'.join(zephyr_modules),
  ],
  verbose: true,
)

application = custom_target(
  output: ['application.bin'],
  command: [
    build_zephyr,
    '--build-tree', meson.current_build_dir() / 'build',
    '--binary-name', 'zephyr.bin',
    '--target-name', 'application.bin',
  ],
)

version = '0.0.0'
header_size = '0x200'
slot_size = '0xc0000'

update_image = custom_target(
  output: ['update-image.bin'],
  command: [
    imgtool,
    'sign',
    '--version', version,
    '--header-size', header_size,
    '--slot-size', slot_size,
    '--key', signing_key,
    application,
    '@OUTPUT@',
  ],
  depends: application,
)

application_signed_confirmed = custom_target(
  output: ['application.signed.confirmed.bin'],
  command: [
    imgtool,
    'sign',
    '--version', version,
    '--header-size', header_size,
    '--slot-size', slot_size,
    '--key', signing_key,
    '--confirm',
    application,
    '@OUTPUT@',
  ],
  depends: application,
)