The invention relates to a
program compilation method and a relevant device. The method comprises the steps of querying a dependent file depended by a selected file to be compiled from a first
directory tree stored on a compilation host; then obtaining the dependent file from a second
directory tree stored on a compilation
server; using the dependent file for compiling the file to be compiled to obtain an
object file. The effect of depending on the other
directory tree (the second directory tree) in addition to the directory tree of the file to be compiled during compilation of Android source codes is realized, a set of complete Android source codes is not required to be downloaded and maintained by research and development personnel, source codes corresponding to a module are only required to be downloaded and the occupied space of a hard disk is reduced. Moreover, the dependent file required by the
object file can be directly obtained from the second directory tree, the dependent file can be obtained without performing compilation and the time and resources for compiling the dependent file are saved. Accordingly, the required hard
disk space and the compilation time are greatly reduced and the
system development efficiency is improved.