Added zip files.

This commit is contained in:
Brad Nelson
2023-12-24 17:35:14 -08:00
parent 18c38cab15
commit 8160a3cb1d
2 changed files with 23 additions and 2 deletions

View File

@ -13,9 +13,10 @@
# limitations under the License.
ESP32_FILES = []
ESP32_ZIP_FILES = []
# Main .ino file.
ESP32_FILES += [
ESP32_ZIP_FILES += [
Importation('esp32/ESP32forth/README.txt',
'$src/esp32/README.txt'),
Importation('esp32/ESP32forth/ESP32forth.ino',
@ -25,7 +26,7 @@ ESP32_FILES += [
Importation('gen/esp32_boot.h', '$src/esp32/esp32_boot.fs', name='boot')
# Optional Compontents.
ESP32_FILES += [
ESP32_ZIP_FILES += [
Importation('esp32/ESP32forth/optional/README-optional.txt',
'$src/esp32/optional/README-optional.txt'),
Esp32Optional('rmt', '$src/esp32/optional/rmt.h', []),
@ -45,6 +46,11 @@ ESP32_FILES += [
[('serial-bluetooth', '$src/esp32/optional/serial-bluetooth/serial-bluetooth.fs')]),
]
# Zip it.
ESP32_FILES += [
Zip('esp32/ESP32forth.zip', ESP32_ZIP_FILES, base='esp32/ESP32forth'),
]
# Simulator.
ESP32_FILES += [
Compile('esp32-sim/esp32-sim', '$src/esp32/sim_main.cpp',

View File

@ -200,6 +200,10 @@ rule convert_image
description = IMAGE_CONVERT
command = convert $in $out
rule zip
description = ZIP
command = rm -f $out && cd $base && zip $relout $relin >/dev/null
"""
@ -281,6 +285,17 @@ def Run(target, source, implicit=[]):
return Simple('run', target, source, implicit)
def Zip(target, sources, base):
global output
ret = Simple('zip', target, ' '.join(sources))
relin = ' '.join([os.path.relpath(i, base) for i in sources])
relout = os.path.relpath(target, base)
output += f' base = {base}\n'
output += f' relout = {relout}\n'
output += f' relin = {relin}\n'
return ret
def Alias(target, source):
global output
output += f'build {target}: phony {source}\n'