When I edit one source file, does running make recompile that file plus all files for which that one is a dependency? If so, why?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Why?
Because that is the whole purpose of having an Make file.
If a particular source file is modified then all dependant files should be recompiled with the modified file so that all of the dependant files refer the same source and the entire code base is in sync.
How?
makeutility checks timestamps to check which files were modified.When an make file is created One needs to specify dependency rules which explicitly tell the utility which other files are dependant on particular file. So using these rules Make compiles all dependent files as well, So that the binaries generated refer the same updated code.