Construction of tight-binding-like potentials on the basis of density-functional theory: Application to carbon.