Basically, I have a large existing code base and I want to wrap all of the .h files in one particular directory using SWIG. Many of the classes in these .h files inherit from other classes defined elsewhere in the directory tree, and it would be a pain to track down each one of them by hand. Is there any way to get SWIG to automatically include these or to at least automate the creation of the .i file? I don't want to wrap any classes outside of my own code (such as the standard library), but these would end up being included if I used the -importall option.
There isn't a builtin way to generate the .i file automatically, or to populate the .i with all .h in a folder and all "other .h to make it work properly"
Part of the reason is that "working properly" is completely arbitrary: if A is in that set of headers you want to export, and A derives from B, do you need to export B "for it to work properly"? Not at all. But you might want to. And even if A returns an instance of B, do you need to export B? No (so don't need import B.h in .i), the object returned by SWIG will be an opaque handle to the B instance, and although you won't be able to call any methods on it, you will be able to give it as argument to functions that accept B as a parameter. 
The most practical is to write a batch or python script to find a base set of the .h you want (a one liner if all in same folder), copy/paste into your .i, and manually cleanup so .i only contains what files you really want to export to target language, and add any missing ones to get certain features you want (like instantiate base classes etc). You can say "no I don't want to have to customize" all you want, you don't have a choice.
How can I wrap many .h files with SWIG and include any dependencies?