In this paper, we propose and demonstrate an approach to optically generating chirped microwave pulses with tunable chirp profile based on optical spectral shaping using a Sagnac loop filter incorporating a chirped fiber Bragg grating (CFBG) and linear wavelength-to-time mapping in a dispersive element. In the proposed approach, the optical power spectrum of an ultrashort optical pulse is shaped by a CFBG-incorporated Sagnac loop mirror that has a reflection spectral response with a linearly increasing or decreasing free spectral range. The spectrum-shaped optical pulse is then sent to a dispersive element to perform the linear wavelength-to-time mapping. A chirped microwave pulse with the pulse shape identical to that of the shaped spectrum is obtained at the output of a high-speed photodector. The central frequency and the chirp profile of the generated chirped microwave pulse can be controlled by simply tuning the time delay in the Sagnac loop mirror. A simple mathematical model to describe the chirped microwave pulse generation is developed. Numerical simulations and a proof-of-principle experiment are implemented to verify the proposed approach.