Home Segments Index Top Previous Next

716: Mainline

Recall that the executable file, analyze_train, described in Chapter 45, depends on three object files. This dependency is reflected in a makefile line in which analyze_train appears, followed by a colon, followed by a list of the depended-on files:

analyze_train: trains.o containers.o cars.o 

A similar line asserts that the trains.o file depends on the trains.cxx file and two included header files:

trains.o: trains.cxx containers.h cars.h 

Finally, the following lines assert that the object files containing member functions depend on both source code files and header files:

containers.o: containers.cxx containers.h 
cars.o: cars.cxx cars.h containers.h 

Note that dependency lines must begin in the first column—no spaces or tabs are permitted.