There is a dedicated tool available to install MegaPirateNG on you flight-controller. The tool is currently only available for Windows and MacOSX.
The latest version is available here
After you select your configuration the tool connects to the MPNG build server and submits your selection. The build server then uses the latest code for the selected version and compiles the code for you. After a successful build, the flashtool downloads the finished hex file and flashes it to your flight-controller.
Downloaded hex files will also be cached locally, so you only need to download the hex file once. If the code changes you automatically get a new hex file.
After selecting all options simple press the “Flash” button to download and install the firmware to your flight-controller.
The first part of the hex name is a md5 hash of your configuration, the second part is the sha1 hash of the last commit of the code the hex file is based on.