f78
Arguments to Specify the Goals
By default, the goal is the first target in the makefile (not counting targets
that start with a period). Therefore, makefiles are usually written so that
the first target is for compiling the entire program or programs they describe.
If the first rule in the makefile has several targets, only the first target in
the rule becomes the default goal, not the whole list.
You can specify a different goal or goals with arguments to
One use of specifying a goal is if you want to compile only a part of the
program, or only one of several programs. Specify as a goal each file that you wish
to remake. For example, consider a directory containing several programs, with
a makefile that starts like the following.
Another use of specifying a goal is to make files that are not normally made.
For example, there may be a file of debugging output, or a version of the
program that is compiled specially for testing, which has a rule in the makefile but
is not a dependency of the default goal.
Another use of specifying a goal is to run the commands associated with a
phony target (see
Following is a list of typical phony and empty target names. See
Makes all the top-level targets about which the makefile knows.
Deletes all files that are normally created by running make.
Like clean, but may refrain from deleting a few files that people normally dont want
to recompile. For example, the mostlyclean target for GCC does not delete libgcc.a, because recompiling it is rarely necessary and takes a lot of time.
realclean
clobber
Any of these targets might be defined to delete more files than clean does. For example, this would delete configuration files or links that you
would normally create as preparation for compilation, even if the makefile
itself cannot create these files.
Copies the executable file into a directory that users typically search for
commands; copy any auxiliary files that the executable uses into the directories
where it will look for them.
Prints listings of the source files that have changed.
Creates a tar file of the source files.
Creates a shell archive (shar file) of the source files.
Creates a distribution file of the source files. This might be a tar file, or a shar file, or a compressed version of one of the previous targets, or even more
than one of the previous targets.
Updates a tags table for this program.
test
Performs self tests on the program this makefile builds.