Default rules for make

T. William Wells bill at twwells.com
Sat Nov 11 06:17:03 AEST 1989


In article <1989Nov8.033800.5104 at monymsys.uucp> david at monymsys.UUCP (David Kozinn) writes:
: make something I've done something like "make CC=gcc foobar", which works just
: fine, but is a minor annoyance. I've looked around for a makefile in some

You can just set a shell variable CC. That is what I do..

As in (Bourne shell):

	CC=gcc; export CC

then run make. I just put this into my .profile and forgot it.
BTW, it works for other make variables as well.

Fixing it in make is not going to be easy: the built in rules are
compiled into make.

An alternate is to get a PD make and use that instead. Assuming
you can find one that is a complete and robust implementation.
Caveat Usor: Many are not.

Oh, another thing: you can't use the shared libraries if you link
with gcc, you have to use cc instead. This leads to my make files
having CC and LDCC, with CC=gcc and LDCC=cc, so that I can add
LDLIB=-lc_s. Another pain is profiling. It doesn't work with gcc
and 3.0e. The fix in the manual is incorrect. I did, however,
create a fix. All of which I'm about to discard: Gnu C 1.36 seems
to work fine, though its optimizer can be an amazing hog. No
doubt I'll have similar irritations with it, but at least I have
the source so I can do the fixes right!

---
Bill                    { uunet | novavax | ankh | sunvice } !twwells!bill
bill at twwells.com



More information about the Comp.unix.microport mailing list