Messages in this thread | | | Date | Tue, 23 Nov 1999 01:29:30 +0100 | From | Dominik Kubla <> | Subject | Re: : NFS Oops - the third today (2.2.13) |
| |
On Mon, Nov 22, 1999 at 09:32:37PM +0100, Daniel Kobras wrote: > On 22 Nov 1999, Miquel van Smoorenburg wrote: ... > > If you simply set CC=gcc272 you're losing the -D__KERNEL__ -I$(HPATH) > > options, and the kernel won't build. > > That's why I suggested the below change to the top-level Makefile some > months ago. Not really pretty but effective when trying to build with > different compilers. ... > --- Makefile.orig Thu Mar 25 13:11:08 1999 > +++ Makefile Thu Mar 25 13:13:13 1999 > @@ -18,11 +18,13 @@ > HOSTCC =gcc > HOSTCFLAGS =-Wall -Wstrict-prototypes -O2 -fomit-frame-pointer > > +TARGETCC =gcc > + > CROSS_COMPILE = > > AS =$(CROSS_COMPILE)as > LD =$(CROSS_COMPILE)ld > -CC =$(CROSS_COMPILE)gcc -D__KERNEL__ -I$(HPATH) > +CC =$(CROSS_COMPILE)$(TARGETCC) -D__KERNEL__ -I$(HPATH) > CPP =$(CC) -E > AR =$(CROSS_COMPILE)ar > NM =$(CROSS_COMPILE)nm
Wrong! The correct fix is not to redefine any of the standard variables! Instead either do force the necessary flags in the make rules in Rules.make or do something like this:
KERNELCFLAGS := -D__KERNEL__ -IS(HPATH)
and then redefine the .c.o: rule in Rules.make to include KERNELCFLAGS before CFLAGS. As for crosscompiling: that can be dropped from the makefile and stuffed into a shell script in the scripts directory. It is so little used that there is really no need to clutter the main makefile with it...
Yours, Dominik Kubla
- 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/
| |