Tuesday, March 19, 2013

Makefile: CFLAGS

By writing the following in the Makefile,
CFLAGS = "-FOO -BAR"
It is equivalent to write the below in the original C files.
#define FOO
#define BAR
So if you have these somewhere in your code,
#ifdef FOO
foo();
#endif

foo() will be executed.

GCC CFLAGS

Flags like -Wall -Wextra are used to pass an option to the compiler. The former means to generate all warnings, the latter extra warnings. Follow link.

No comments:

Post a Comment