lkml.org 
[lkml]   [1998]   [Dec]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: linux-kernel-digest V1 #3051
Hi Pierfrancesco,

> But I still have to edit it to change the compiler to use egcc.
> Would it be possible to define a single variable to choose the
> compiler, so that I can pass a value on the command line?

It's possible to reduce it to two variables, but not one.

The host compiler and the target compiler must be kept separate
so that cross-compiling works. Consider someone on an i386 who is
building a kernel for an alpha machine. They need HOSTCC to
compile helper programs like scripts/mkdep.c, and CC to compile
the main body of the code.

Try something like this:

HOSTCC =egcc
HOSTCFLAGS =-Wall -Wstrict-prototypes -O2 -fomit-frame-pointer

TARGETCC =egcc
TARGETCFLAGS =-D__KERNEL__ -I$(HPATH)

CROSS_COMPILE =
AS =$(CROSS_COMPILE)as
LD =$(CROSS_COMPILE)ld
CC =$(CROSS_COMPILE)$(TARGETCC) $(TARGETCFLAGS)
CPP =$(CC) -E

If that works for you, mail me a patch, and I'll test it myself
and submit it to Alan Cox.

Michael Elizabeth Chastain
<mailto:mec@shout.net>
"love without fear"

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:46    [W:0.020 / U:0.136 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site