#!/bin/bash # Iterate through every target architecture, running rest of command line # on each $TARGET. # If $FORK is set, run them in parallel with filtered output. source sources/utility_functions.sh || exit 1 test -z $(ARCHES) && global ARCHES := $[ls sources/targets] for TARGET in [$ARCHES] { test ! -f "sources/targets/$TARGET" && continue announce "$TARGET running" maybe_fork "$ifsjoin(Argv) 2>&1 | maybe_quiet" } wait (CommandList children: [ (AndOr children: [(C {(.)} {(sources/utility_functions.sh)}) (C {(exit)} {(1)})] op_id: Op_DPipe ) (AndOr children: [ (C {(Lit_Other "[")} {(-z)} {(DQ (${ VSub_Name ARCHES))} {(Lit_Other "]")}) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:ARCHES) op: Equal rhs: { (DQ (CommandSubPart command_list: (CommandList children:[(C {(ls)} {(sources/targets)})]) left_token: spids: [43 47] ) ) } spids: [41] ) ] spids: [41] ) ] op_id: Op_DAmp ) (ForEach iter_name: TARGET iter_words: [{($ VSub_Name "$ARCHES")}] do_arg_iter: False body: (DoGroup children: [ (AndOr children: [ (C {(Lit_Other "[")} {(KW_Bang "!")} {(-f)} {(DQ (sources/targets/) ($ VSub_Name "$TARGET"))} {(Lit_Other "]")} ) (ControlFlow token:) ] op_id: Op_DAmp ) (C {(announce)} {(DQ ($ VSub_Name "$TARGET") (" running"))}) (C {(maybe_fork)} {(DQ ($ VSub_Star "$*") (" 2>&1 | maybe_quiet"))}) ] spids: [59 95] ) spids: [56 -1] ) (C {(wait)}) ] )