From c1af5b5de8c5fe2d9766af50677c640402d4efef Mon Sep 17 00:00:00 2001 From: Gediminas Jakutis Date: Mon, 27 May 2019 13:25:35 +0300 Subject: build system: device building improvements. No longer depends on having the adhoc "espmake" in $PATH. This change now requires a few more explicit meson configuration options to build the firmware. Signed-off-by: Gediminas Jakutis --- src/device/meson.build | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) (limited to 'src/device') diff --git a/src/device/meson.build b/src/device/meson.build index d2e3c6e..10723b0 100644 --- a/src/device/meson.build +++ b/src/device/meson.build @@ -5,17 +5,32 @@ if get_option('fwbuild') libpath = get_option('oledlib') assert((libpath != ''), 'path to oled lib is empty') + mkesppath = get_option('makeesparduino') + assert((mkesppath != ''), 'path to directory with makeEspArduino.mk is empty') + + esplib = get_option('esplib') + assert((esplib != ''), 'path esplib is empty') + + board = get_option('board') + oledlib = [] foreach i : oledlibnames oledlib += files(libpath + '/' + i) endforeach + mkespard = files(mkesppath + '/makeEspArduino.mk') + assert((oledlib != []), 'oled lib not found in the supplied lib directory') espmake = find_program('espmake') printf = find_program('printf') cat = find_program('cat') cp = find_program('cp') + make = find_program('make') + nproc = find_program('nproc') + + nproc_out = run_command(nproc) + cpus = nproc_out.stdout().strip() fw_filenames = ['main.ino', 'DejaVu_Sans_Mono_13.h', @@ -51,7 +66,17 @@ if get_option('fwbuild') fw = custom_target('fw', output : fw_image, input : [fw_sources, fw_conf], - command : [espmake, '-C', builddir, '&&', cp, '/tmp/mkESP/main_d1_mini/main.bin', '@OUTDIR@/' + fw_image], + command : [make, + '-f', + mkespard, + 'ESP_ROOT=' + esplib, + 'BOARD=' + board, '-j' + cpus, + '-C', + builddir, + '&&', + cp, + '/tmp/mkESP/main_d1_mini/main.bin', + '@OUTDIR@/' + fw_image], install : true, install_dir : resource_dir) -- cgit v1.2.3