October 2000
Intermediate to advanced
432 pages
9h 9m
English
The make program attempts to bring a target up-to-date by bringing all the target's dependencies up-to-date. These dependencies may have further dependencies. Thus, a potentially complex dependency graph forms when processing a typical 'Makefile':
all: foo
foo: foo.o bar.o baz.o
.c.o:
$(CC) $(CFLAGS) -c $< -o $@@
.l.c:
$(LEX) $< && mv lex.yy.c $@@
From a simple file that looks like this one, we can draw a dependency graph such as the one in Figure 3.1.

Unless the 'Makefile' contains a directive to make, all targets are assumed to be filenames, and rules must be written to ...
Read now
Unlock full access