
m
make(1) | make(1) |
The most common use of the archive interface follows. Here, we assume the source ®les are all C type source:
lib: lib(file1.o) lib(file2.o) lib(file3.o) @echo lib is now
.c.a:
$(CC)
rm
(See the section on
lib: lib(file1.o) lib(file2.o) lib(file3.o) $(CC)
ar rv lib $? rm $?
@echo lib is now
.c.a:;
Here substitution in the macros is used. The $? list is de®ned to be the set of object ®le names (inside lib) whose C source ®les are
Archive members containing the de®nition of a symbol are designated by double parentheses around the symbol name, lib((entry_name)), but are otherwise handled as described above.
make has knowledge about some special targets. These must be speci®ed in the make®le to take effect (with the exception of .SUFFIXES, which is automatically set by make but can be changed by the user).
.DEFAULT If a ®le must be made but there are no explicit commands or relevant
.PRECIOUS Dependents of this target are not removed when QUIT, INTERRUPT, TERMINATE, or HANGUP are received.
.SILENT Same effect as the
.IGNORE Same effect as the
.SUFFIXES The explicit dependents of .SUFFIXES are added to the
.MUTEX Serialize the updating of speci®ed targets (See the Parallel Make Section).
There are ®ve internally maintained macros that are useful for writing rules for building targets. In order to clearly de®ne the meaning of these macros, some clari®cation of the terms target and dependent is necessary. When make updates a target, it may actually generate a series of targets to update. Before any rule (either explicit or implicit) is applied to the target to update it, recursion takes place on each dependent of the target. The dependent, upon recursion, becomes a target itself, and may have or generate its own dependents, which in turn are recursed upon until a target is found that has no dependents, at which point the recursion stops. Not all targets processed by make appear as explicit targets in the make®le; some of them are explicit dependents from the make®le while others are implicit dependents generated as make recursively updates the target. For instance, when the following make®le is executed:
pgm: a.o b.o
cc a.o b.o
Section 1−514 | − 7 − |