In a project involving more than one executable (or other final products), the traditional makefile target for compiling all the executables is called all. If the products are program1, program2 and program3, the all target will take the form

all: program1 program2 program2

# The above blank line is IMPORTANT!
This tells make that in order to make the all target, all three programs have to be up-to-date, but that no further commands need to be performed. It is also possible to touch some dummy indicator file, by saying
all: program1 program2 program3
        touch all
# The above line MUST start with a TAB!
but this has no real advantages.

Generally, the all target is the first target in the makefile, so saying "make" has the same effect as saying "make all".

Log in or register to write something here or to contact authors.