See [http://grass.osgeo.org/wiki/Compile_and_Install Compile and Install] instruction from GRASS Wiki.