116 GNU make
For example, the recipe used to compile a C source file actually says ‘$(CC) -c $(CFLAGS)
$(CPPFLAGS)’. The default values of the variables used are ‘cc’ and nothing, resulting in
the command ‘cc -c’. By redefining ‘CC’ to ‘ncc’, you could cause ‘ncc’ to be used for
all C compilations performed by the implicit rule. By redefining ‘CFLAGS’ to be ‘-g’, you
could pass the ‘-g’ option to each compilation. All implicit rules that do C compilation use
‘$(CC)’ to get the program name for the compiler and all include ‘$(CFLAGS)’ among the
arguments given to the compiler.
The variables used in implicit rules fall into two classes: those that are names of programs
(like CC) and those that contain arguments for the programs (like CFLAGS). (The “name of
a program” may also contain some command arguments, but it must start with an actual
executable program name.) If a variable value contains more than one argument, separate
them with spaces.
The following tables describe of some of the more commonly-used predefined variables.
This list is not exhaustive, and the default values shown here may not be what make selects
for your environment. To see the complete list of predefined variables for your instance of
GNU make you can run ‘make -p’ in a directory with no makefiles.
Here is a table of some of the more common variables used as names of programs in
built-in rules:
AR Archive-maintaining program; default ‘ar’.
AS Program for compiling assembly files; default ‘as’.
CC Program for compiling C programs; default ‘cc’.
CXX Program for compiling C++ programs; default ‘g++’.
CPP Program for running the C preprocessor, with results to standard output; de-
fault ‘$(CC) -E’.
FC Program for compiling or preprocessing Fortran and Ratfor programs; default
‘f77’.
M2C Program to use to compile Modula-2 source code; default ‘m2c’.
PC Program for compiling Pascal programs; default ‘pc’.
CO Program for extracting a file from RCS; default ‘co’.
GET Program for extracting a file from SCCS; default ‘get’.
LEX Program to use to turn Lex grammars into source code; default ‘lex’.
YACC Program to use to turn Yacc grammars into source code; default ‘yacc’.
LINT Program to use to run lint on source code; default ‘lint’.
MAKEINFO Program to convert a Texinfo source file into an Info file; default ‘makeinfo’.
TEX Program to make T
E
X dvi files from T
E
X source; default ‘tex’.
TEXI2DVI Program to make T
E
X dvi files from Texinfo source; default ‘texi2dvi’.
WEAVE Program to translate Web into T
E
X; default ‘weave’.
CWEAVE Program to translate C Web into T
E
X; default ‘cweave’.
Comentarios a estos manuales