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. |
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++. |
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.
|
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. |