meson.build 1.35 KB
Newer Older
Rahix's avatar
Rahix committed
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
name = 'pycardium'

modsrc = files(
)

#################################
# MicroPython Generated Headers #
#################################

version_h = custom_target(
  'mpversion.h',
  output: 'mpversion.h',
  command: [micropython_gen_version, '@OUTPUT@'],
)

modules_h = custom_target(
  'moduledefs.h',
  output: 'moduledefs.h',
  input: [micropython_sources, modsrc],
  command: [micropython_gen_modules, '@OUTPUT@', '@INPUT@'],
)

qstr_h = custom_target(
  'qstrdefs.generated.h',
  output: 'qstrdefs.generated.h',
  input: [
    # 'modules/qstrdefs.h',
    'mpconfigport.h',
    micropython_sources,
  ],
  depends: [modules_h, version_h],
  command: [micropython_gen_qstr, meson.current_source_dir(), '@OUTPUT@', '@INPUT@'],
)

mp_headers = [version_h, modules_h, qstr_h]

###################
# MicroPython Lib #
###################

upy = static_library(
  'micropython',
  micropython_sources,
  micropython_additional_sources,
  mp_headers,
  include_directories: micropython_includes,
)

executable(
  name + '.elf',
  'main.c',
  'mphalport.c',
  modsrc,
  mp_headers,
  include_directories: micropython_includes,
Rahix's avatar
Rahix committed
56
  dependencies: [max32665_startup_core1, board_card10, periphdriver, api_caller],
Rahix's avatar
Rahix committed
57
58
59
60
61
62
  link_whole: [max32665_startup_core1_lib, board_card10_lib],
  link_with: upy,
  link_args: [
    '-Wl,-Map=' + meson.current_build_dir() + '/' + name + '.map',
  ],
)