A talking makefile

Post by Nico Brailovsky @ 2011-09-06 | Permalink | 1 comments | Leave a comment

So, after learning how to use makefiles, then how to use makefiles for TDD and for code coverage report, now you need to annoy your whole team with a talking makefile. What could be better to notify everyone on your team when a test fails than a synthesized voice commanding you to fix your program?

test: $(TEST_SRCS)
    @for TEST in $(TEST_BINS); do
        make "$$TEST";
        echo "Execute $(TEST)";
        if ! ./$$TEST; then
            echo "Oh noes! I detected a failed test from $$TEST. Go and fix your program!" | festival --tts ;
    done

Try it. You'll love it.

Bonus chatter: when Valgrind detects over $MUCHOS errors it'll print "Too many errors detected. Go and fix your program", then it won't print so much detail in the next backtraces.


In reply to this post, Links 7/9/2011: Linux World Domination, China Picks IBM’s GNU/Linux Mainframe | Techrights commented @ 2011-09-07T20:13:23.000+02:00:

[...] talking makefile [...]

Original published here.