Verified Commit 393f95a1 authored by Rahix's avatar Rahix
Browse files

build: Introduce meson as the new build-system


Signed-off-by: Rahix's avatarRahix <rahix@rahix.de>
parent 8a17c522
#TARGET = max32665
#COMPILER = GCC
#export TARGET
#export COMPILER
all: sdk subdirs
travis:
$(MAKE) ADDFLAGS=-Werror lib subdirs
subdirs:
$(MAKE) -C bootloader
sdk/Libraries/MAX32665PeriphDriver/Build/PeriphDriver.a:
# $(MAKE) -C sdk/Libraries/MAX32665PeriphDriver
sdk/Libraries/MAXUSB/Build/maxusb.a:
# $(MAKE) -C sdk/Libraries/MAXUSB
sdk: sdk/Libraries/MAX32665PeriphDriver/Build/PeriphDriver.a sdk/Libraries/MAXUSB/Build/maxusb.a
clean:
$(MAKE) -C bootloader clean
# $(MAKE) -C sdk/Libraries/MAX32665PeriphDriver clean
# $(MAKE) -C sdk/Libraries/MAXUSB clean
[binaries]
c = 'arm-none-eabi-gcc'
ar = 'arm-none-eabi-ar'
strip = 'arm-none-eabi-strip'
[properties]
# TODO: Switch to hard float
c_args = ['-mthumb', '-mcpu=cortex-m4', '-mfloat-abi=hard', '-mfpu=fpv4-sp-d16', '-Wa,-mimplicit-it=thumb', '-ffunction-sections', '-fdata-sections', '-fsingle-precision-constant', '-fno-isolate-erroneous-paths-dereference']
c_link_args = ['-mthumb', '-mcpu=cortex-m4', '-mfloat-abi=hard', '-mfpu=fpv4-sp-d16']
target_defs = ['-DTARGET=32665', '-DTARGET_REV=0x4131', '-DBOARD_CARD10=1']
[host_machine]
system = 'none'
cpu = 'cortex-m4'
cpu_family = 'arm'
endian = 'little'
name = 'bmatest'
executable(
name + '.elf',
'main.c',
dependencies: [libcard10],
link_args: [
'-Wl,-Map=' + meson.current_build_dir() + '/' + name + '.map',
],
)
name = 'bmetest'
executable(
name + '.elf',
'main.c',
dependencies: [libcard10],
link_args: [
'-Wl,-Map=' + meson.current_build_dir() + '/' + name + '.map',
],
)
name = 'ecgtest'
executable(
name + '.elf',
'main.c',
dependencies: [libcard10],
link_args: [
'-Wl,-Map=' + meson.current_build_dir() + '/' + name + '.map',
],
)
name = 'hello-world'
executable(
name + '.elf',
'main.c',
dependencies: [libcard10],
link_args: [
'-Wl,-Map=' + meson.current_build_dir() + '/' + name + '.map',
],
)
name = 'imutest'
executable(
name + '.elf',
'main.c',
dependencies: [libcard10],
link_args: [
'-Wl,-Map=' + meson.current_build_dir() + '/' + name + '.map',
],
)
name = 'ips'
executable(
name + '.elf',
'main.c',
'image/image.c',
'image/image2.c',
dependencies: [libcard10],
link_args: [
'-Wl,-Map=' + meson.current_build_dir() + '/' + name + '.map',
],
)
subdir('bmatest/')
subdir('bmetest/')
subdir('ecgtest/')
subdir('hello-world/')
subdir('imutest/')
subdir('ips/')
includes = include_directories(
'./',
)
sources = files(
'bosch.c',
'card10.c',
'leds.c',
'pmic.c',
)
lib = static_library(
'card10',
sources,
include_directories: includes,
dependencies: [
bhy1,
bma400,
bme680,
board_card10,
libgfx,
max77650,
periphdriver,
],
)
libcard10 = declare_dependency(
include_directories: includes,
link_with: lib,
dependencies: [
bhy1,
bma400,
bme680,
board_card10,
libgfx,
max32665_rt,
max77650,
periphdriver,
],
)
includes = include_directories(
'./',
'./Fonts/',
'./GUI_DEV/',
'./LCD/',
)
sources = files(
'./GUI_DEV/DEV_Config.c',
'./GUI_DEV/GUI_Paint.c',
'./LCD/LCD_Driver.c',
'./display.c',
'./Fonts/font8.c',
'./Fonts/font12.c',
'./Fonts/font12CN.c',
'./Fonts/font16.c',
'./Fonts/font20.c',
'./Fonts/font24.c',
'./Fonts/font24CN.c',
)
lib = static_library(
'gfx',
sources,
include_directories: includes,
dependencies: periphdriver,
c_args: '-Wno-missing-braces',
)
libgfx = declare_dependency(
include_directories: includes,
link_with: lib,
)
subdir('./sdk/')
subdir('./vendor/Bosch/BHy1/')
subdir('./vendor/Bosch/BME680/')
subdir('./vendor/Bosch/BMA400/')
subdir('./vendor/Maxim/MAX77650/')
subdir('./gfx/')
subdir('./card10/')
includes = include_directories(
'./Include/',
'../Include/',
)
sources = files(
'./Source/board.c',
'../Source/led.c',
'../Source/mx25.c',
'../Source/pb.c',
)
lib = static_library(
'board-card10',
sources,
include_directories: includes,
dependencies: periphdriver,
)
libstdio = static_library(
'board-stdio',
'../Source/stdio.c',
include_directories: includes,
dependencies: periphdriver,
)
board_card10 = declare_dependency(
include_directories: includes,
link_with: lib,
link_whole: libstdio,
)
sources = files(
'./Source/GCC/startup_max32665.S',
'./Source/system_max32665.c',
'./Source/heap.c',
)
lib = static_library(
'max32665-rt',
sources,
dependencies: periphdriver,
)
max32665_rt = declare_dependency(
link_whole: lib,
link_args: [
'-T', meson.current_source_dir() + 'Source/GCC/max32665.ld',
'--entry', 'Reset_Handler',
],
)
includes = include_directories(
'Include/',
'../CMSIS/Device/Maxim/MAX32665/Include/',
'../CMSIS/Include/',
)
sources = files(
'Source/adc.c',
'Source/cipher.c',
'Source/crc.c',
'Source/dma.c',
'Source/dvs.c',
'Source/emcc.c',
'Source/flc.c',
'Source/gpio.c',
'Source/hash.c',
'Source/htmr.c',
'Source/i2c.c',
'Source/icc.c',
'Source/lp.c',
'Source/maa.c',
'Source/mem_utils.c',
'Source/mxc_assert.c',
'Source/mxc_delay.c',
'Source/mxc_lock.c',
'Source/mxc_pins.c',
'Source/mxc_sys.c',
'Source/nvic_table.c',
'Source/owm.c',
'Source/pt.c',
'Source/rpu.c',
'Source/rtc.c',
'Source/sdhc.c',
'Source/sema.c',
'Source/simo.c',
'Source/spi.c',
'Source/spi17y.c',
'Source/spixf.c',
'Source/spixfc.c',
'Source/spixr.c',
'Source/startup_core1.S',
'Source/system_core1.c',
'Source/tmr.c',
'Source/tmr_utils.c',
'Source/trng.c',
'Source/uart.c',
'Source/wdt.c',
'Source/wut.c',
)
lib = static_library(
'PeriphDriver',
sources,
include_directories: includes,
)
periphdriver = declare_dependency(
include_directories: includes,
link_with: lib,
)
subdir('./Libraries/MAX32665PeriphDriver/')
subdir('./Libraries/CMSIS/Device/Maxim/MAX32665/')
subdir('./Libraries/Boards/card10/')
includes = include_directories(
'./driver/inc/',
'./examples/firmware/',
# For bosch.h
'../../../card10/',
)
sources = files(
'./driver/src/bhy.c',
'./driver/src/bhy_support.c',
'./driver/src/bhy_uc_driver.c',
)
lib = static_library(
'bhy1',
sources,
include_directories: includes,
dependencies: periphdriver,
)
bhy1 = declare_dependency(
include_directories: includes,
link_with: lib,
)
includes = include_directories(
'./',
)
sources = files(
'./bma400.c',
)
lib = static_library(
'bma400',
sources,
include_directories: includes,
)
bma400 = declare_dependency(
include_directories: includes,
link_with: lib,
)
includes = include_directories(
'./',
)
sources = files(
'./bme680.c',
)
lib = static_library(
'bme680',
sources,
include_directories: includes,
)
bme680 = declare_dependency(
include_directories: includes,
link_with: lib,
)
includes = include_directories(
'./',
)
lib = static_library(
'max77650',
'MAX77650-Arduino-Library.c',
dependencies: periphdriver,
)
max77650 = declare_dependency(
include_directories: includes,
link_with: lib,
)
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment