Following a build log with -f never ends by itself, even after the build is long done. GNU tail can watch the process too.
tail -f --pid=1234 build.log
When process 1234 exits, tail prints what is left and quits. In a script, $! gives you the ID of the job you just started in the background:
./build.sh > build.log 2>&1 &
tail -n +1 -f --pid=$! build.log
echo "build finished"
The -n +1 shows the file from the first line, so nothing written before tail started is missed. The last line runs once the build is over.
For something that is already running, find the ID first:
pgrep -f build.sh
I like it in CI style scripts, where output should stream live and the script must continue afterwards. To get the exit status of the job itself, add wait $! after tail.
This is a GNU option, so check tail --help on other systems before relying on it. It watches only the one process. If that process starts a child that keeps writing and then exits, tail stops while output is still coming. Process IDs are also reused eventually, so do not store one and use it an hour later.
Further reading: tail invocation