Roland Ver. 4.5 Informações Técnicas Página 110

  • Descarregar
  • Adicionar aos meus manuais
  • Imprimir
  • Página
    / 212
  • Índice
  • MARCADORES
  • Avaliado. / 5. Com base em avaliações de clientes
Vista de página 109
100 GNU make
targets not in the makefile may be specified, if make can find implicit rules that say how to
make them.
Make will set the special variable MAKECMDGOALS to the list of goals you specified on the
command line. If no goals were given on the command line, this variable is empty. Note
that this variable should be used only in special circumstances.
An example of appropriate use is to avoid including .d files during clean rules (see
Section 4.13 [Automatic Prerequisites], page 38), so make won’t create them only to imme-
diately remove them again:
sources = foo.c bar.c
ifneq ($(MAKECMDGOALS),clean)
include $(sources:.c=.d)
endif
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 this:
.PHONY: all
all: size nm ld ar as
If you are working on the program size, you might want to say ‘make size’ so that only
the files of that program are recompiled.
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 prerequisite of
the default goal.
Another use of specifying a goal is to run the recipe associated with a phony target
(see Section 4.5 [Phony Targets], page 29) or empty target (see Section 4.7 [Empty Target
Files to Record Events], page 31). Many makefiles contain a phony target named clean
which deletes everything except source files. Naturally, this is done only if you request it
explicitly with make clean’. Following is a list of typical phony and empty target names.
See Section 15.6 [Standard Targets], page 157, for a detailed list of all the standard target
names which GNU software packages use.
all Make all the top-level targets the makefile knows about.
clean Delete all files that are normally created by running make.
mostlyclean
Like clean’, but may refrain from deleting a few files that people normally
don’t want to recompile. For example, the mostlyclean target for GCC does
not delete li/jointfilesconvert/351026/bgcc.a, because recompiling it is rarely necessary and takes a lot
of time.
distclean
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.
Vista de página 109
1 2 ... 105 106 107 108 109 110 111 112 113 114 115 ... 211 212

Comentários a estes Manuais

Sem comentários