Make script to silence output unless errors and always recompile
Revision as of 02:07, 29 January 2022 by Adam.birds (talk | contribs) (Created page with "'''Here is the script to silence output when running make unless their are errors, it will also always recompile too:''' <pre> #!/bin/bash # Ensure no targets end with .c ar...")
Here is the script to silence output when running make unless their are errors, it will also always recompile too:
#!/bin/bash
# Ensure no targets end with .c
args=""
invalid_args=0
for arg; do
case "$arg" in
(*.c) arg=${arg%.c}; invalid_args=1;;
esac
args="$args $arg"
done
if [ $invalid_args -eq 1 ]; then
echo "Did you mean 'make$args'?"
exit 1
fi
# Run make
/usr/bin/make -B -s $*
Copy the above into the below file:
/usr/local/bin/make
Then run:
sudo chmod +x /usr/local/bin/make