Originally Posted by xirtyllo
great tip, i'll try it soon!
but by the way, is .bashrc the right way to set the CFLAGS (i use Slackware 13) or are there better methods?
Searching on google i saw someone putting the CFLAGS argument just after the make bzImage command...
Yeah, putting CFLAGS on the make command-line works in the same way as the command I showed earlier - e.g:
is the same as:
...BUT this is only because of the way the `make' program parses its arguments - don't expect that to work for other programs.
As for if there are 'better' methods, I personally prefer to set CFLAGS on the make command-line, or manually in the environment before a particular compilation, and not in any configuration files. This is simply because I might forget about it and have it infest a compilation I don't want to.
Oh, and just in case you're wanting to compile the kernel with `-O3' (I'm getting that feeling from you
), you should definitely make sure you can compile a kernel AND get it working without setting any `-O*' CFLAGS - the Linux kernel is a big system, and if I remember correctly, compiling with `-O3' is basically guaranteed to break it. By all means try it, but make sure you can do it without -O3 first, so if it does fail to build/run, you know why.