The command 'make is a very powerful programmer's aide. Multiple file programs which use additional functions from one or more libraries of functions can cause compile command lines to become exceedingly long. The compiler has to be told where stuff is via command line file names and options. This includes (1) all the header files, something.h, where declarations are to be found, (2) all the code files, such as something.cc, where code to be compiled is to be found, and (3) all the compiled functions, something.o, which may even be in a library, somelib.a. To avoid the hassle of typing the complicated compiler command over and over during debugging, make allows you to specify all the gory details in a file, usually called 'Makefile. To understand Makefiles, you need three concepts: target, dependency, action. The target is the thing to be made, usually a ready to run program, such as a.out, but sometimes a .o file or other file. A .o file contains some functions which are compiled, but not yet assembled into a runnable program. The dependencies are the files that are used in making the target. They are usually code and header files, .cc and .h. The action is the command(s) needed to build the target. ####################### For example, a Makefile may contain these lines. war: war.cc deck.h card.h deck.o card.o g++ war.cc deck.o card.o -o war The pattern is : * The command "make war" causes the make system to scan your Makefile for the target war. If a file 'war already exists which is newer than any of the dependency files, make does nothing, considering the target to be up-to-date. If the file does not exist, or is older, because something has been changed in one of the files on which war depends), then make runs the action, in this case the command to compile it. This principle is first applied recursively to the dependency files. Thus if deck.o doesn't exist, "make war" will first look for it as a target and make it before going on to make the overall target "war" ####################### #Thus a complete Makefile for the war card game would look like this: war: war.cc deck.h card.h deck.o card.o g++ war.cc deck.o card.o -o war card.o: card.cc card.h g++ card.cc -c deck.o: deck.cc deck.h card.h g++ deck.cc -c