CFLAGS

From Wikipedia, the free encyclopedia

CFLAGS and CXXFLAGS are either the name of environment variables or of Makefile variables that can be set to specify additional switches to be passed to a compiler in the process of building computer software.

These variables are usually set inside a Makefile and are then appended to the command line when the compiler is invoked. If they are not specified in the Makefile, then they will be read from the environment, if present. Tools like autoconf's ./configure script will usually pick them up from the environment and write them into the generated Makefiles.

CFLAGS allows to add switches for the C compiler, while CXXFLAGS is meant to be used when invoking a C++ compiler. Similarly, a variable CPPFLAGS exists with switches to be passed to the C preprocessor.

These variables are most commonly used to specify optimization or debugging switches to a compiler, as for example -g, -O2 or (GCC-specific) -march=athlon.

[edit] See also

[edit] External links

Languages