[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <AANLkTi=fH924fybfmSpxyOu5Vm8Ny9cSyMGWcQN3dvvD@mail.gmail.com>
Date: Sun, 3 Oct 2010 15:31:01 +0400
From: Frank Coldwell <junkdnaseq@...il.com>
To: linux-kernel@...r.kernel.org
Subject: gcc compile kernel 2.6 module
Hi all,
Does anybody know how should look gcc compilation line
to compile kernel module for kernel 2.6
In 2.4 it looks like this:
----------------------------------------------------
TARGET := hello-1
WARN := -W -Wall -Wstrict-prototypes -Wmissing-prototypes
INCLUDE := -isystem /lib/modules/`uname -r`/build/include
CFLAGS := -O2 -DMODULE -D__KERNEL__ ${WARN} ${INCLUDE}
CC := gcc-3.0
${TARGET}.o: ${TARGET}.c
.PHONY: clean
clean:
rm -rf ${TARGET}.o
----------------------------------------------------
and for multiple sourceĀ files, like this:
----------------------------------------------------
CC=gcc
MODCFLAGS := -O -Wall -DMODULE -D__KERNEL__
hello.o: hello2_start.o hello2_stop.o
ld -m elf_i386 -r -o hello2.o hello2_start.o hello2_stop.o
start.o: hello2_start.c
${CC} ${MODCFLAGS} -c hello2_start.c
stop.o: hello2_stop.c
${CC} ${MODCFLAGS} -c hello2_stop.c
----------------------------------------------------
Kind regards,
Dragoslav Zaric
MSc Astrophysics
Professional programmer
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists