Infrared (IR) spectroscopy is an efficient method for identifying unknown chemical compounds. To accelerate IR spectrum analysis, various calculation and machine learning methods for simulating IR spectra of molecules have been studied in chemical science. However, existing calculation and machine learning methods assumed a rigid constraint that all molecules are in the gas phase, i.e., they overlooked the phase dependency of the IR spectra. In this paper, we propose an efficient phase-aware machine learning method to generate phase-conditioned IR spectra from 2D molecular structures. To this end, we devised a phase-aware graph neural network and combined it with a transformer decoder. To the best of our knowledge, the proposed method is the first IR spectrum generator that can generate the phase-conditioned IR spectra of real-world complex molecules. The proposed method outperformed state-of-the-art methods in the tasks of generating IR spectra on a benchmark dataset containing experimentally measured 11,546 IR spectra of 10,288 unique molecules. All implementations of the proposed method are publicly available at https://github.com/ngs00/PASGeN.