DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 
make

Suggestions and warnings

The most common difficulties can arise from your understanding of make's specific meaning of dependency. If file x.c has a:

   #include "defs.h"
line, then the object file x.o depends on defs.h; the source file x.c does not. If defs.h is changed, nothing is done to the file x.c while file x.o must be recreated.

To discover what make would do, the -n option is very useful. The command

   $ make -n
orders make to print out the commands that make would issue without actually taking the time to execute them.

If a change to a file is minor (such as adding a comment to an include file), the -t (touch) option can save a lot of time. Instead of issuing a large number of superfluous recompilations, make updates the modification times on the affected file.

   make -ts
This command (-ts stands for touch silently) causes the relevant files to appear up-to-date. Obvious care is necessary because this mode of operation subverts the intention of make and destroys all memory of the previous relationships.

Next topic: Makefile example
Previous topic: Environment variables

© 2003 Caldera International, Inc. All rights reserved.
SCO OpenServer Release 5.0.7 -- 11 February 2003