Selective build - like custom build server but with waf

I have a PixHawk1-1M which is getting pretty close to running out of flash. I want to be able to build on my local for this board and because I don’t need a lot of stuff, so I think I should have heaps of room, if I could leave out the things I don’t need, but waf seems to build in everything.
I’m thinking I should be able to do something like the custom build server with waf - have a command (I’ll put it in a script) that selectively builds and links the stuff I need while leaving out what I don’t so that I can fit my dev work on my PixHawk.
I’ve looked (maybe in the wrong place?) - I can’t figure out how I would do this. Can anyone help?

If youre building copter, there’s APM_Config.h in ‘ardupilot/arducopter/’ which will allow you to disable some features by uncommenting the relavant lines.

Thanks - it seems there is config.h in plane which does that, but it doesn’t seem to be able to compile out much (e.g. various device drivers), do you know where that would be?