The invention provides a source code analysis method based on makefile dependency. The method includes the following steps of 1, a dependency relationship extraction stage; 2, a source code information extraction stage; 3, an object definition search stage. The dependency relationship extraction stage includes the steps of firstly, information conversion, wherein a makefile is processed to obtain a corresponding intermediate file; secondly, redundant information processing, wherein redundant information in the intermediate file is removed; thirdly, dependency information extraction, wherein dependency information is extracted from the intermediate file; fourthly, ending. The source code information extraction stage includes the steps that firstly, source code content is analyzed to obtain source code information; secondly, symbol conversion is carried out, wherein symbols in the source code information are processed; thirdly, an index is established to establish data mapping; fourthly, the process is ended. The object definition search stage includes the steps that firstly, a file search range is confirmed, and a corresponding dependency file list is searched for; secondly, the definition position is confirmed, and the data mapping is searched for symbol information; thirdly, the process is ended. According to the source code analysis method based on makefile dependency, firstly, the file search range is determined, and then symbol definition position information is determined. By defining the file range, the accuracy of symbol definition search in source code analysis is improved to a great extent.