-
Notifications
You must be signed in to change notification settings - Fork 0
/
Interview Questions
11 lines (10 loc) · 1.02 KB
/
Interview Questions
1
2
3
4
5
6
7
8
9
10
11
How make Processes a Makefile?
make reads the makefile in the current directory and begins by processing the first rule. These rules say to update each ‘.o’
file by compiling its source file. The recompilation must be done if the source file, or any of the header files named as
prerequisites, is more recent than the object file, or if the object file does not exist.After recompiling whichever object
files need it, make decides whether to relink. This must be done if the elf file does not exist, or if any of the object
files are newer than it. If an object file was just recompiled, it is now newer than elf file, so elf is relinked.
For example, Thus, if we change the file insert.c and run make, make will compile that file to update insert.o, and then link
edit. If we change the file command.h and run make, make will recompile the object files kbd.o, command.o and files.o and then
link the file edit.
------------------------------------------------------------------------------------------------------------------------------