CS246 Lecture Notes - Lecture 13: Os 2200
Document Summary
But if only one or a few of those files have changed, then only those need to be re-compiled before compiling the executable. There is a command called make which helps us to maintain and track changes for a group of programs. It helps us to figure out the most efficient way to compile a program. If book. cc or book. h [dependences] has last modified time later than book. o [target] then make will just rebuild. Suppose main. o depends on book. o. book. o depends on book. h and book. cc. Thus if book. h or book. cc is updated, book. o is updated and this main. o is updated make clean removes everything makefile supports variables. The mmd flag for g++ will produce textbook. d which will have all the dependencies. So you don"t even have to write the dependecies yourself, there"s a command for it. Use -include variable to read the content and insert it in the variable.