See [http://grass.gdf-hannover.de/wiki/Compile_and_Install Compile and Install] instruction from GRASS Wiki.