From bdc5b4e3373bb40a044c8eb3c173fa654bfd936b Mon Sep 17 00:00:00 2001 From: Brad Nelson Date: Mon, 15 Jan 2024 12:06:34 -0800 Subject: [PATCH] Add install of optional modules. --- configure.py | 12 ------------ esp32/BUILD | 25 ++++++++++++++++++++++++- 2 files changed, 24 insertions(+), 13 deletions(-) diff --git a/configure.py b/configure.py index adbac71..45adfbe 100755 --- a/configure.py +++ b/configure.py @@ -374,18 +374,6 @@ def Importation(target, source, header_mode='cpp', name=None, keep=False, deps=N return target -def Esp32Optional(main_name, main_source, parts): - implicit = [] - for name, source in parts: - implicit.append(Importation('$dst/gen/esp32_' + name + '.h', - source, name=name.replace('-', '_') + '_source')) - return Importation('$dst/esp32/ESP32forth/optional/' + main_name + '.h', - main_source, - keep=True, - deps='$dst/gen/esp32_optional_' + main_name + '.h.d', - implicit=implicit) - - def Simple(op, target, source, implicit=[]): global output implicit = ' '.join(implicit) diff --git a/esp32/BUILD b/esp32/BUILD index d961f2c..30da1d1 100644 --- a/esp32/BUILD +++ b/esp32/BUILD @@ -15,6 +15,7 @@ OPTIONS = '-I $src/esp32' ESP32_FILES = [] ESP32_ZIP_FILES = [] +ESP32_OPTIONAL_INSTALL = [] # Main files. ESP32_ZIP_FILES += [ @@ -26,6 +27,23 @@ ESP32_ZIP_FILES += [ ] Importation('$dst/gen/esp32_boot.h', '$src/esp32/esp32_boot.fs', name='boot') + +def Esp32Optional(main_name, main_source, parts): + global ESP32_OPTIONAL_INSTALL + ESP32_OPTIONAL_INSTALL.append( + Copy('$dst/esp32/ESP32forth/' + main_name + '.h', + '$dst/esp32/ESP32forth/optional/' + main_name + '.h')) + implicit = [] + for name, source in parts: + implicit.append(Importation('$dst/gen/esp32_' + name + '.h', + source, name=name.replace('-', '_') + '_source')) + return Importation('$dst/esp32/ESP32forth/optional/' + main_name + '.h', + main_source, + keep=True, + deps='$dst/gen/esp32_optional_' + main_name + '.h.d', + implicit=implicit) + + # Optional Compontents. ESP32_ZIP_FILES += [ Importation('$dst/esp32/ESP32forth/optional/README-optional.txt', @@ -66,7 +84,8 @@ ESP32_FILES += [ '$dst/esp32-sim/Esp32forth-sim')), TestCommand('$dst/tests/esp32_sim_see_all_test.out', '$dst/esp32-sim/Esp32forth-sim', - 'echo internals see-all bye | $dst/esp32-sim/Esp32forth-sim 2>&1 | cat >$dst/tests/esp32_sim_see_all_test.out'), + 'echo internals see-all bye | $dst/esp32-sim/Esp32forth-sim 2>&1 | ' + 'cat >$dst/tests/esp32_sim_see_all_test.out'), ] Compile('$dst/gen/print-esp32-builtins', '$src/esp32/print-builtins.cpp'), Run('$dst/gen/esp32_sim_opcodes.h', '$dst/gen/print-esp32-builtins') @@ -115,3 +134,7 @@ Alias('esp32all', ' '.join([i + '-build' for i in BOARDS.keys()])) Alias('putty', OneShot('$dst/gen/putty.not', '', '$${HOME}/Desktop/putty.exe -serial $${PORT:-com3} -sercfg 115200')) + +Alias('add-optional', ' '.join(ESP32_OPTIONAL_INSTALL)) +Alias('drop-optional', OneShot('$dst/gen/drop.not', '', + 'rm -f ' + ' '.join(ESP32_OPTIONAL_INSTALL)))