Stop make if find -exec returns not zero

Viewed 1940

I'm trying to integrate checking my code using pyflakes into a building process. I've defined the following target in my Makefile:

pyflakes:
    find $(APPLICATION_DIRECTORY) -iname "*.py" -exec pyflakes "{}" \;

The problem is that find returns 0 every time even if there are code issues (pyflakes returns not 0) and make succeeds. Ideally, I want to run the check on every source file and stop make if at least one of -exec failed. Is there a way to achieve this?

3 Answers
Related