The Unix make utility allows the programmer to specify dependencesamong the sepa
ID: 3608304 • Letter: T
Question
The Unix make utility allows the programmer to specify dependencesamong theseparately compiled pieces of a program. If file A depends on fileB and file B is modified, make
deduces that A must be recompiled, in case any of the changes to Bwould affect the code
produced for A. How accurate is this sort of dependence management?Under what
circumstances will it lead to unnecessary work? Under whatcircumstances will it fail to
recompile something that needs to be recompiled?
I said that if for example, source file A depends on B and yousimply change source file B's comments, and didn't change the codeit will recompile B and A when really only B's comments werechanged so taht was unncessary. But i'm not sure how accuratethis sort of dependence is, and also i don't know under whatcircumstances it will fail to reocmpile something that needs to berecompiled.
Thanks
Explanation / Answer
File A depends on File B, and if File Bis modified then there will be change in File A. Since, there is achange in File A, it should be recompiled.
According to dependency, both are filesare accurate. Because if one is modified another file is alsomodified and is recompiled. So, maximum dependency occurs betweenthe files A & B.
Clearly File A depends on File B, if File Bis modified then File A should be recompiled. This is general case.Now if File B modification does not effect much change in File Athen the re-compilation is unnecessary work. In some cases if FileB is not changed and A is recompiled, then also it is anunnecessary work.
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.