Right. Have a look in distutils to see how it implements the 'build' command; it runs subcommands.