linux-qubasis

linux oasis port as a qubes template

git clone https://9o.is/git/linux-qubasis.git

commit 638f879f128ff75a06edbfa5cedf9f9a56b334b1
parent 37dff38dc264d526c9e03b080f16f89531c7ca13
Author: Jul <jul@9o.is>
Date:   Sat,  8 Nov 2025 07:48:42 -0500

add phony ninja function

Diffstat:
Mninja/functions.sh | 38++++++++++++++++++++++----------------
1 file changed, 22 insertions(+), 16 deletions(-)

diff --git a/ninja/functions.sh b/ninja/functions.sh @@ -70,6 +70,12 @@ build() { printf 'build %s: %s %s\n' "$_v2" "$_v1" "$_vs" >> "$_ninja_writepath" } +phony() { + _ninja_prefix _out $tgtdir $1 + shift + build phony "$_out" $* +} + gen() { build gen $*; } cc() { build cc $*; } ar() { build ar $*; } @@ -386,10 +392,10 @@ _ninja_target() { fi if [ "$_vs" ]; then - build phony $tgtdir/$_tgt $_vs + phony $_tgt $_vs elif [ $_empty ]; then touch $_empty - build phony $tgtdir/$_tgt $outdir/$_empty + phony $_tgt $outdir/$_empty fi } @@ -638,15 +644,15 @@ _ninja_flush_build() { esac done - build phony $tgtdir/build-pkgs $_subgens_pkg - build phony $tgtdir/build-tpls $_subgens_tpl - build phony $tgtdir/build $_subgens + phony build-pkgs $_subgens_pkg + phony build-tpls $_subgens_tpl + phony build $_subgens _subgens_tpl_install= for _v in $_subgens_tpl; do _subgens_tpl_install="$_subgens_tpl_install ${_v%build}install" done - build phony $tgtdir/install $_subgens_tpl_install + phony install $_subgens_tpl_install ;; pkg) _ninja_save build $_subgens @@ -654,7 +660,7 @@ _ninja_flush_build() { ;; tpl) fspec_tar $outdir/root.tar.zstd '|' $hostdir/fspec-tar $outdir/_fspec/ALL - build phony $tgtdir/build $outdir/root.tar.zstd + phony build $outdir/root.tar.zstd if [ "$_ninja_template" ]; then set -- $_ninja_template @@ -672,7 +678,7 @@ _ninja_flush_build() { bind tar $outdir/root.tar.zstd fi - build phony $tgtdir/install $outdir/qubes-installed + phony install $outdir/qubes-installed fi ;; esac @@ -694,10 +700,10 @@ _ninja_flush_sync() { case $_ninja_type in root) - build phony $tgtdir/sync $_subgens + phony sync $_subgens ;; tpl) - build phony $tgtdir/sync $outdir/_synced + phony sync $outdir/_synced for src in $_ninja_buffer_sync; do copy $outdir/_sync/${src#$etcdir/} $src @@ -705,7 +711,7 @@ _ninja_flush_sync() { if [ "$_ninja_buffer_sync" ]; then _ninja_dedup _ninja_buffer_sync $_ninja_buffer_sync - build phony "$_ninja_buffer_sync" $outdir/_synced + phony "$_ninja_buffer_sync" $outdir/_synced else touch _synced fi @@ -723,10 +729,10 @@ _ninja_flush_sync() { done fi - build phony $tgtdir/sync $outdir/_fetch/fetched $_patches $_subgens + phony sync $outdir/_fetch/fetched $_patches $_subgens if [ "$_ninja_buffer_sync" ]; then _ninja_dedup _ninja_buffer_sync $_ninja_buffer_sync - build phony "$_ninja_buffer_sync" $outdir/_fetch/fetched $_patches + phony "$_ninja_buffer_sync" $outdir/_fetch/fetched $_patches fi ;; esac @@ -775,7 +781,7 @@ _ninja_flush_fspec() { done case $_ninja_type in - root) build phony $tgtdir/fspec $_subgens;; + root) phony fspec $_subgens;; *) if [ ! "$_srcs" ] && [ ! "$_ninja_buffer_fspec_files" ]; then touch _fspec/ALL @@ -783,7 +789,7 @@ _ninja_flush_fspec() { cat _fspec/ALL $_srcs $_ninja_buffer_fspec_files fi - build phony $tgtdir/fspec $outdir/_fspec/ALL + phony fspec $outdir/_fspec/ALL ;; esac } @@ -799,7 +805,7 @@ _ninja_flush_configure() { _subgens="$_subgens \$tgtdir/$_v/configure" done - build phony $gendir/configure $ninjadir/$_ninja_file $_subgens + phony configure $ninjadir/$_ninja_file $_subgens gen $ninjadir/$_ninja_file '|' $basedir/config.sh $basedir/ninja/functions.sh $dir/gen.sh }