To improve the utilization of resources and construct a cost-efficient platform simultaneously performing both radar and communication functions, the integrated radar and communication system (IRCS) is introduced. Although it is desirable to maximize the channel capacity for communication while maintaining the desired detection probability for radar, doing so for a frequency-selective fading channel or frequency-sensitive target results in considerable performance degradation of the ability of the orthogonal frequency division multiplexing (OFDM) IRCS, referred to as OFDM-IRCS, to perform equal transmit power allocation. To alleviate the problem, we propose an adaptive transmit power allocation method by optimally designing the transmitted waveform. A joint optimization problem is devised by taking both the radar detection performance and communication channel capacity into the objective function and a closed-form solution is derived. Moreover, the optimal condition, under which both the radar detection performance and communication capacity are optimal, is investigated. Otherwise, it is unavoidable to make a compromise. Finally, several numerical results are presented to verify the effectiveness of the proposed approach.