When running a CMake generated Makefile with multiple processes (make -jN
), the output often gets messed up like this:
[ 8%] [ 8%] [ 9%] Buil
Here is a simple working example of using a wrapper for Make. I'm not sure if I'd encourage it's use, but it's an idea.
# Makefile
SHELL = /tmp/test/wrapper
test: test1 test2
test1:
$(eval export TARGET=$@)
env
test2:
$(eval export TARGET=$@)
env
and this:
#!/usr/bin/env bash
# wrapper
bash $@ | sed -e "s/^/${TARGET} /"