A new code concept is used for the L1 civil (L1C) signal of the global positioning system (GPS). The generation of L1C codes is quite different from the generation of traditional ranging codes. Thus, it is necessary to find a method for the correct generation to pave the way for future research. L1C codes are based on only one Legendre sequence which consists of Legendre symbols. To calculate these Legendre symbols, the Euler criterion is always used to evaluate quadratic residues. However, due to the great length of L1C codes, this procedure causes overflow problems. Therefore, the quadratic reciprocity law, some related theorems and properties are introduced to solve the problems. Moreover, if the quadratic reciprocity law, some related theorems and properties are used to calculate different Legendre symbols, the combination modes may vary, which causes a complex generation process. The proposed generation method deals with this complex generation process effectively. In addition, through simulations, it is found that the autocorrelation features of obtained Legendre sequences and L1C codes are in accordance with theoretical results, which proves the correctness of the proposed method.