Mansome, back up. There is an easier way.
Download and install Noobs and use the whole SD card.
When installing an OS, choose OpenELEC and Raspian. That way you can dual boot the system, have KODI on openELEC and build RetroPie on Raspian from binary.
You don’t need to compile anything yourself, I have that exact setup and it works great. Post here with any questions.