[comp.unix.i386] Default rules for make

david@monymsys.uucp (David Kozinn) (11/08/89)

From somewhere in the dark recesses of my mind, I seem to remember that
there's some way to specify what some of the rules are that make uses. I know
that in the absence of a [Mm]akefile, there are a set of rules that are used
to determine how to build a program. The default set of rules defines
something like :
	.c.o:
		$(CC) ..... blah blah

Here's the problem: I'm running Microport Sys V/386 and using the Green Hills
C compiler. I would prefer that instead of the default value of "cc" being
used for the $CC macro that gcc be used instead. For the time being, when I
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
place logical (like /etc or /usr/lib) but can't find one. Aside from creating
an alias (or equivalent) for make, is there some simple way that I can change
these defaults? Thanks.
-- 
David Kozinn            | UUCP:      {rutgers | uunet}!cbmvax!cgh!monymys!david
MONY Financial Services	| UUCP:      ...!rutgers!princeton!mccc!monymsys!david
Glenpointe Center West  | Internet:  cgh!monymsys!david@manta.pha.pa.us
Mail Drop 75-14         | GEnie:     D.KOZINN
Teaneck, NJ 07666-6888  | Telephone: +1-201-907-6990

david@monymsys.uucp (David Kozinn) (11/13/89)

Thanks for all the replies to this, both via mail and in news. The consensus
seems to be that the simplest way to do this is to simply put the lines:
	CC=gcc
	export CC
in my .profile to be executed at login, and all will work as desired. (It
does!) 

A number of people pointed out that make -p will display the set of rules that
apply, and that if you have the source to make (which I don't), then you can
modify the default rules used in rules.c and recompile. Finally, for project-
specific things, simply putting a CC=gcc line in the project makefile will
work well.

Thanks again for all the replies.
-- 
David Kozinn            | UUCP:      {rutgers | uunet}!cbmvax!cgh!monymys!david
MONY Financial Services	| UUCP:      ...!rutgers!princeton!mccc!monymsys!david
Glenpointe Center West  | Internet:  cgh!monymsys!david@manta.pha.pa.us
Mail Drop 75-14         | GEnie:     D.KOZINN
Teaneck, NJ 07666-6888  | Telephone: +1-201-907-6990