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

@ -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'