[Toybox] [PATCH] Add makefile rule to build kconfig; fixes clean-tree parallel builds
Avery Terrel
averymt at proton.me
Tue Mar 3 14:38:15 PST 2026
Accidentally replied to Rob first...
On Tuesday, March 3rd, 2026 at 14:11, Rob Landley <rob at landley.net> wrote:
> Sigh. I'm aware that mac (and cygwin?) builds suck. Would a "forkbomb"
> parallel build of the prereq stuff help?
I've actually had few issues building on Cygwin. The issues I've come
across have all been in the code, not the build system. I should work
on finishing and upstreaming my local patches...
> I believe this is posix-2008:
>
> for i in lib/*.c $FILES
> do
> X=${FILES##*/} X=${X%.c}
> $BUILD -c $i -o $X.o &
> done
> wait
> $BUILD $LINK *.o -o toybox-prereq && rm *.o || exit 1
>
> (The hard part of parallel builds is the rate limiting. If you just want
> to launch EVERYTHING in parallel then wait and link... well that. Sigh,
> I need a way to comment out the last line of build.sh so use.sh could do
> the parallel one instead. "Simple" a moving target when you add
> features...)
Here's a sample script for limiting jobs. `jobs -p` must print only
the group leader PID for each job in `%d\n` format
#!/bin/sh
busy() {
end=$(($(date +%s) + $1))
while [ $(date +%s) -lt $end ]
do
done
}
i=0
while [ $i -lt 100 ]
do
while [ $(jobs -p | wc -l) -gt 10 ]
do
done
busy $(($i % 10 + 1)) &
i=$(($i + 1))
done
wait
More information about the Toybox
mailing list