There is also a tool called Bear which will generate compile commands from Make-based builds, in case you were wondering. I've used it with some success.
Im well aware of bear. Works fine in some cases, not so well in others. Author is also doing scan-build replacement in python which imho is far superior to bear.