It can be done the same way as with other files. To use it in mojoportal you create a new skin (master page is just one part of skin) and copy it to the correct location using post build events.
to use in mojoPortal your master page should inherit code behind from the same base class as other layout.master files in existing skins.
note that the skin or master page is not a concern of modules, it is set at the page level not at the feature instance.