Make GNU make use a different compiler
If the makefile is written like most makefiles, then it uses $(CC)
when it wishes to invoke the C compiler. That's what the built-in rules do, anyway. If you specify a different value for that variable, then Make will use that instead. You can provide a new value on the command line:
make CC=/usr/bin/special-cc
You can also specify that when you run configure
:
./configure CC=/usr/bin/special-cc
The configuration script will incorporate the new CC
value into the makefile that it generates, so you don't need to manually edit it, and you can just run make
by itself thereafter (instead of giving the custom CC
value on the command line every time).