I've been having trouble with this. It's probably because the port I'm testing (my WIP of Pidgin 3) uses autogen.sh for both configuration and compilation.
I've tried the obvious way ('scan-build make build'). In that case I only get a report for the autogen.sh test programs, although the main compilation also uses the static analyzer. I've also tried using a couple different env vars to prepend scan-build, but they caused errors. Any tips?