Skip to content
Snippets Groups Projects
Select Git revision
  • d23fbdd045561294e388f09ba87e0199a6a5bf7a
  • master default protected
  • add-utime-unix_time-expansion
  • add-monotonic-time
  • add-digiclk
  • genofire/rockets-state
  • genofire/ble-follow-py
  • plaetzchen/ios-workaround
  • blinkisync-as-preload
  • genofire/haule-ble-fs-deactive
  • schneider/max30001-pycardium
  • schneider/max30001-epicaridum
  • schneider/max30001
  • schneider/stream-locks
  • schneider/fundamental-test
  • schneider/ble-buffers
  • schneider/maxim-sdk-update
  • ch3/splashscreen
  • koalo/bhi160-works-but-dirty
  • koalo/wip/i2c-for-python
  • renze/safe_mode
  • v1.9
  • v1.8
  • v1.7
  • v1.6
  • v1.5
  • v1.4
  • v1.3
  • v1.2
  • v1.1
  • v1.0
  • release-1
  • bootloader-v1
  • v0.0
34 results

meson.build

Blame
  • Forked from card10 / firmware
    1403 commits behind the upstream repository.
    Rahix's avatar
    rahix authored
    This commit adds a script to embed the git-version of the firmware into
    the bootloader, epicardium, and pycardium.  All three binaries will
    display their version on startup.
    
    Signed-off-by: default avatarRahix <rahix@rahix.de>
    f3830f3c
    History
    meson.build 2.28 KiB
    name = 'pycardium'
    
    modsrc = files(
      'modules/fat_file.c',
      'modules/fat_reader_import.c',
      'modules/interrupt.c',
      'modules/sys_leds.c',
      'modules/light_sensor.c',
      'modules/sys_display.c',
      'modules/utime.c',
      'modules/vibra.c',
    )
    
    #################################
    # 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_mod_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,
        micropython_extmod_sources,
      ],
      depends: [version_h],
      command: [micropython_gen_qstr, meson.current_source_dir(), '@OUTPUT@', '@INPUT@'],
    )
    
    mp_headers = [version_h, modules_h, qstr_h]
    
    #################################
    #    Python Frozen Modules      #
    #################################
    
    subdir('modules/py')
    
    frozen_source = custom_target(
      'frozen.c',
      output: 'frozen.c',
      input: [qstr_h, frozen_modules],
      build_by_default: true,
      command: [micropython_gen_frozen, '@OUTPUT@', '@INPUT@'],
    )
    
    ###################
    # MicroPython Lib #
    ###################
    
    upy = static_library(
      'micropython',
      micropython_sources,
      micropython_additional_sources,
      micropython_extmod_sources,
      mp_headers,
      include_directories: micropython_includes,
    )
    
    elf = executable(
      name + '.elf',
      'main.c',
      'patch.c',
      'mphalport.c',
      frozen_source,
      modsrc,
      mp_headers,
      version_hdr,
      include_directories: micropython_includes,
      dependencies: [max32665_startup_core1, periphdriver, api_caller],
      link_with: upy,
      link_whole: [max32665_startup_core1_lib, api_caller_lib],
      link_args: [
        '-Wl,-Map=' + meson.current_build_dir() + '/' + name + '.map',
      ],
    )
    
    bin = custom_target(
      name + '.bin',
      build_by_default: true,
      output: name + '.bin',
      input: elf,
      command: [build_image, '@INPUT@', '@OUTPUT0@'],
    )
    
    custom_target(
      name + '_epicardium.bin',
      build_by_default: true,
      output: name + '_epicardium.bin',
      input: [epicardium_bin, bin],
      command: [build_multi_image, '@INPUT@', '@OUTPUT0@'],
    )