The final option is to just write the G-code yourself. Libraries like mecode give you precise control over the tool path, and thus are useful if you have a complex print that is not suitable for naive slicing. Another option for G-code generation is to use a lower level library like mecode. Slicers are the easiest way to go from a 3D model to a printed part, however the user sacrifices some flexibility when using them. These programs import a CAD model, slice it into layers, and output the G-code required to print each layer. One method would be to use a slicing program such as Slic3r, Skeinforge or Cura. There are a few different ways to prepare G-code for a printer. Codes for print head movements follow the NIST RS274NGC G-code standard, so RepRap firmwares are quite usable for CNC milling and similar applications as well. The main target is additive fabrication using FFF processes.
This page tries to describe the flavour of G-codes that the RepRap firmwares use and how they work.