LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   What is CFLAGS variable used in Makefiles for? (https://www.linuxquestions.org/questions/programming-9/what-is-cflags-variable-used-in-makefiles-for-271218/)

Nerox 12-28-2004 01:23 PM

What is CFLAGS variable used in Makefiles for?
 
Hello there, i noticed a variable called CFLAGS inside Makefiles, it differs from other variables, so, what is it for?

Thanks in advance.

leonscape 12-28-2004 01:54 PM

Its for passing flags to the C compiler. Things like -ansi ( use ANSI standard C ) -W ( Turn on Warnings ) -Wall ( Report all warnings ) and many others.

There's also CPPFLAGS and CXXFLAGS, mainly used for C++.

Nerox 12-28-2004 02:35 PM

Yeah, so i must store all gcc flags i want to use in CFLAGS assigning flags with the = ,and then, adding more ones with the += operator. Thanks.

Mara 12-28-2004 05:03 PM

You don't have to, you can add them directly to the commands. CFLAGS is good when you need one set of options for all files (like optimization, warinings etc).


All times are GMT -5. The time now is 03:11 PM.