The command to prepare the module-dependencies (/sbin/depmod) is usually executed by a command such as /sbin/installkernel, which is a script. The exact sequence that is performed by your distro can vary considerably.
The place to start looking is probably in
<linuxversion>/arch/i386/Makefile. This is probably the "topmost level" makefile ... which references targets that are defined in other Makefiles such as <linuxversion>/Makefile. (Where <linuxversion> is simply my way of referring to whatever-directory you put your kernel source into, for the purposes of this posting.)
On my formerly-RedHat system, this Makefile invokes /sbin/installkernel which, in turn, invokes /sbin/new-kernel-package and a few other scripts.
If you are moving away from "the distro's way of doing things" and compiling your own custom kernel, you may find that some of those scripts have to be modified to suit your new modus operandi. (For example, since I no longer use an initrd, I had to stop the new-kernel-package script from trying to build one.)