public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "Américo Wang" <xiyou.wangcong@gmail.com>
To: Frank Coldwell <junkdnaseq@gmail.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: gcc compile kernel 2.6 module
Date: Mon, 4 Oct 2010 10:03:57 +0800	[thread overview]
Message-ID: <20101004020357.GA5189@cr0.nay.redhat.com> (raw)
In-Reply-To: <AANLkTi=fH924fybfmSpxyOu5Vm8Ny9cSyMGWcQN3dvvD@mail.gmail.com>

On Sun, Oct 03, 2010 at 03:31:01PM +0400, Frank Coldwell wrote:
>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

In 2.6, it would be much simpiler, kbuild has some pre-defined
variables for you to use, so you don't need to, e.g. specify
INCLUDE and CFLAGS in this way.

Please read Documentation/kbuild/*.

      parent reply	other threads:[~2010-10-04  1:59 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-10-03 11:31 gcc compile kernel 2.6 module Frank Coldwell
2010-10-03 17:01 ` Jiri Slaby
2010-10-04  2:03 ` Américo Wang [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20101004020357.GA5189@cr0.nay.redhat.com \
    --to=xiyou.wangcong@gmail.com \
    --cc=junkdnaseq@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox