The Makefile is fairly complicated, so I
don't want to get into a line-by-line explication;
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 her changes into the NIS database. So
you need to check whether 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 timestamp 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:
passwd: passwd.time
passwd.time: /etc/master/passwd
@ lots of commands that rebuild the database
@ touch passwd.time
@ more commands to distribute the new database
hosts: hosts.time
hosts.time: similar stuff