Dependencies

The dependencies of a target are the objects which a particular target depends upon. If a target depends upon an object, then the dependent object must be updated before the target may be updated. A target is not up-to-date if its dependencies are not all up-to-date.

Additional dependencies can be added to a target defined in another rule by writing a new rule which declares the additional dependencies. Only one of the rules may contain command lines, otherwise it is an error. An example where this might be done is given below:

target1.o target2.o : global.h
target1.o : one.h
target2.o : two.h