I have a project I'm constantly building that doesn't use a makefile, but I want to set CFLAGS anyway. Just setting the CFLAGS environment variable won't change the options gcc actually uses. Is there a way to set some kind of variable that gcc will pick up and use? (Changing some file on my hard drive with default cflags also works too.)
EDIT: Here's an example:
Code:
[Leo@chessman ~]$ cat test.c
#include <stdio.h>
int main(){
#ifdef HELLO
printf("Hello\n");
#else
printf("Not Hello\n");
#endif
return 0;
}
[Leo@chessman ~]$ export CFLAGS=-DHELLO
[Leo@chessman ~]$ gcc -o test test.c
[Leo@chessman ~]$ ./test
Not Hello
[Leo@chessman ~]$ gcc -DHELLO -o test test.c
[Leo@chessman ~]$ ./test
Hello
[Leo@chessman ~]$
For example, Is there some substitute for "export CFLAGS=-DHELLO" that will make gcc define HELLO?