From 754bbf7a25a8dda49b5d08ef0d0443bbf5af0e36 Mon Sep 17 00:00:00 2001 From: Craig Jennings Date: Sun, 7 Apr 2024 13:41:34 -0500 Subject: new repository --- devdocs/gnu_make/implicit-variables.html | 44 ++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 devdocs/gnu_make/implicit-variables.html (limited to 'devdocs/gnu_make/implicit-variables.html') diff --git a/devdocs/gnu_make/implicit-variables.html b/devdocs/gnu_make/implicit-variables.html new file mode 100644 index 00000000..639f9884 --- /dev/null +++ b/devdocs/gnu_make/implicit-variables.html @@ -0,0 +1,44 @@ +

Variables Used by Implicit Rules

The recipes in built-in implicit rules make liberal use of certain predefined variables. You can alter the values of these variables in the makefile, with arguments to make, or in the environment to alter how the implicit rules work without redefining the rules themselves. You can cancel all variables used by implicit rules with the ‘-R’ or ‘--no-builtin-variables’ option.

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; default ‘$(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 TeX DVI files from TeX source; default ‘tex’.

TEXI2DVI
+

Program to make TeX DVI files from Texinfo source; default ‘texi2dvi’.

WEAVE
+

Program to translate Web into TeX; default ‘weave’.

CWEAVE
+

Program to translate C Web into TeX; default ‘cweave’.

TANGLE
+

Program to translate Web into Pascal; default ‘tangle’.

CTANGLE
+

Program to translate C Web into C; default ‘ctangle’.

RM
+

Command to remove a file; default ‘rm -f’.

+

Here is a table of variables whose values are additional arguments for the programs above. The default values for all of these is the empty string, unless otherwise noted.

ARFLAGS
+

Flags to give the archive-maintaining program; default ‘rv’.

ASFLAGS
+

Extra flags to give to the assembler (when explicitly invoked on a ‘.s’ or ‘.S’ file).

CFLAGS
+

Extra flags to give to the C compiler.

CXXFLAGS
+

Extra flags to give to the C++ compiler.

COFLAGS
+

Extra flags to give to the RCS co program.

CPPFLAGS
+

Extra flags to give to the C preprocessor and programs that use it (the C and Fortran compilers).

FFLAGS
+

Extra flags to give to the Fortran compiler.

GFLAGS
+

Extra flags to give to the SCCS get program.

LDFLAGS
+

Extra flags to give to compilers when they are supposed to invoke the linker, ‘ld’, such as -L. Libraries (-lfoo) should be added to the LDLIBS variable instead.

LDLIBS
+

Library flags or names given to compilers when they are supposed to invoke the linker, ‘ld’. LOADLIBES is a deprecated (but still supported) alternative to LDLIBS. Non-library linker flags, such as -L, should go in the LDFLAGS variable.

LFLAGS
+

Extra flags to give to Lex.

YFLAGS
+

Extra flags to give to Yacc.

PFLAGS
+

Extra flags to give to the Pascal compiler.

RFLAGS
+

Extra flags to give to the Fortran compiler for Ratfor programs.

LINTFLAGS
+

Extra flags to give to lint.

+
+

+ Copyright © 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020, 2021, 2022 Free Software Foundation, Inc.
Licensed under the GNU Free Documentation License.
+ https://www.gnu.org/software/make/manual/html_node/Implicit-Variables.html +

+
-- cgit v1.2.3