Thinking about make will pay off in many ways. One way to get ideas about how to use it is to look at other makefiles .
One of my favorites is the makefile for(formerly called yp, or "Yellow Pages"). I like this makefile because it does something that you'd never think of doing, even though it suits make perfectly: updating a distributed database.
The makefile is fairly complicated, so I don't want to get into a line-by-line explication of the makefile ; but I will give you a sketch of how it works. Here's the problem. A system administrator updates one or more files (we'll say the passwd file), and wants to get his changes into the yp database. So you need to check whether or not the new password file is more recent than the database. Unfortunately, the database isn't represented by a single file, so there's nothing to "check" against. The NIS makefile handles this situation by creating empty files that serve as timestamps. There's a separate .time file for every database that NIS serves. When you type make , make checks every master file against the corresponding timestamp. If a master file is newer than the timestamp, make knows that it has to rebuild part of the database. After rebuilding the database, the makefile "touches" the timestamp, so that it reflects the time at which the database was built.
The makefile looks something like this:
You may never need to write a makefile this complicated; but you should look for situations in which you can use make profitably. It isn't just for programming.