![recompile with cmake recompile with cmake](https://i.stack.imgur.com/LON3e.png)
If you anticipate the problem before changing the header file, you can use the `-t' flag. Being conservative, make assumes that any change in the header file requires recompilation of all dependent files, but you know that they do not need recompilation and you would rather not waste your time waiting for them to compile. For example, suppose you add a macro or a declaration to a header file, on which the other files depend. Sometimes you may have changed a source file but you may not want to recompile all the files that depend on it. There may be a project consisting of thousands of files. If source file has a newer time stamp than the object file, then it generates new object file assuming that the source file has been changed. While compiling a file, the make checks its object file and compares the time stamps. However if you make any change in main.cpp, as this is not dependent of any other file, then only main.cpp file is recompiled, and help.cpp and factorial.cpp are not. Hence if you make any changes in functions.h, then the make recompiles all the source files to generate new object files. If you have four files main.cpp, hello.cpp, factorial.cpp and functions.h, then all the remaining files are dependent on functions.h, and main.cpp is dependent on both hello.cpp and factorial.cpp. The make program is an intelligent utility and works based on the changes you do in your source files.