Added install step.

This commit is contained in:
Brad Nelson
2023-12-31 21:40:52 -08:00
parent 0e8264fa09
commit db939fb889
2 changed files with 14 additions and 0 deletions

View File

@ -16,3 +16,5 @@ Alias('posix', 'posix/ueforth')
Importation('gen/posix_boot.h', '$src/posix/posix_boot.fs', name='boot') Importation('gen/posix_boot.h', '$src/posix/posix_boot.fs', name='boot')
Compile('posix/ueforth', '$src/posix/main.c', Compile('posix/ueforth', '$src/posix/main.c',
implicit=['gen/posix_boot.h']) implicit=['gen/posix_boot.h'])
OneShot('install', 'sudo cp posix/ueforth /usr/bin/ueforth', 'posix/ueforth')

View File

@ -212,6 +212,11 @@ rule gen_run
description = GEN_RUN description = GEN_RUN
command = $script $options $infiles >$out command = $script $options $infiles >$out
rule oneshot
description = ONESHOT
command = $command
pool = console
rule clean rule clean
description = CLEAN description = CLEAN
command = ninja -t clean command = ninja -t clean
@ -332,6 +337,13 @@ def GenRun(target, script, options, sources):
return target return target
def OneShot(target, command, source):
global output
output += f'build {target}: oneshot {source}\n'
output += f' command = {command}\n'
return target
def Default(target): def Default(target):
global output global output
output += f'default {target}\n' output += f'default {target}\n'