
GNU make (and other variants of make) do precisely this. Using this information, make can also optimize the build process avoiding unnecessary steps. The advantages of make over scripts is that you can specify the relationships between the elements of your program to make, and it knows through these relationships and timestamps exactly what steps need to be redone to produce the desired program each time.

The make program is intended to automate the mundane aspects of transforming source code into an executable. Moreover, as the program’s complexity grows these mundane tasks can become increasingly error-prone as different versions of the program are developed, perhaps for other platforms or other versions of support libraries, etc. Later they discover that they were never executing their modified function because of some procedural error such as failing to recompile the source, relink the executable, or rebuild a jar. Most developers have experienced the frustration of modifying a function and running the new code only to find that their change did not fix the bug. Although transforming the source into an executable is considered routine, if done incorrectly a programmer can waste immense amounts of time tracking down the problem. The mechanics of programming usually follow a fairly simple routine of editing source files, compiling the source into an executable form, and debugging the result.

Chapter 1. How to Write a Simple Makefile
