diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/device/meson.build | 27 |
1 files changed, 26 insertions, 1 deletions
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) |