Temperature evolution of infrared- and Raman-active phonons in graphite