From db939fb8897d60e832cd5e8f94934094569b03ff Mon Sep 17 00:00:00 2001 From: Brad Nelson Date: Sun, 31 Dec 2023 21:40:52 -0800 Subject: [PATCH] Added install step. --- posix/BUILD | 2 ++ tools/configure.py | 12 ++++++++++++ 2 files changed, 14 insertions(+) diff --git a/posix/BUILD b/posix/BUILD index 2ec8b91..aeb5b26 100644 --- a/posix/BUILD +++ b/posix/BUILD @@ -16,3 +16,5 @@ Alias('posix', 'posix/ueforth') Importation('gen/posix_boot.h', '$src/posix/posix_boot.fs', name='boot') Compile('posix/ueforth', '$src/posix/main.c', implicit=['gen/posix_boot.h']) + +OneShot('install', 'sudo cp posix/ueforth /usr/bin/ueforth', 'posix/ueforth') diff --git a/tools/configure.py b/tools/configure.py index bebe961..1006e7c 100755 --- a/tools/configure.py +++ b/tools/configure.py @@ -212,6 +212,11 @@ rule gen_run description = GEN_RUN command = $script $options $infiles >$out +rule oneshot + description = ONESHOT + command = $command + pool = console + rule clean description = CLEAN command = ninja -t clean @@ -332,6 +337,13 @@ def GenRun(target, script, options, sources): 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): global output output += f'default {target}\n'