public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Sam Ravnborg <sam@ravnborg.org>
To: Jari Ruusu <jariruusu@users.sourceforge.net>
Cc: Sam Ravnborg <sam@ravnborg.org>,
	Vincent C Jones <vcjones@NetworkingUnlimited.com>,
	linux-kernel@vger.kernel.org
Subject: Re: Linux 2.6.6-rc3
Date: Wed, 28 Apr 2004 21:08:55 +0200	[thread overview]
Message-ID: <20040428190855.GA4069@mars.ravnborg.org> (raw)
In-Reply-To: <408FE8C4.33B3BDB4@users.sourceforge.net>

> 
> Full package:
> http://loop-aes.sourceforge.net/loop-AES/loop-AES-v2.0g.tar.bz2

Hi Jari.
I took a look at how you use the build system in the 2.6 kernel.
Inherited from the 2.4 days you assemble the commands yourself,
which is plain wrong in a 2.6 kernel.
The only sane way to build external modules with a 2.6 kernel is
to utilise the kbuild infrastructure.

For your reference here is a Makefile that I used to compile your
module (made a symling for loop-patched.c file).

To compile the kernel I used:
make -C /home/sam/bk/v2.6/ M=$PWD
[Assumes latest linus kernel - 2.6.6-rc3]

For older kernels append the modules target

This has the added benefit that Module versioning is also supported.

#########################
# Minimal kbuild Makefile for loop-AES

EXTRA_CFLAGS := $(LOOP_AES_CFLAGS)

obj-m := loop.o

i586-$(CONFIG_M586) := -i586
i586-$(CONFIG_M686) := -i586

loop-y := loop-patched.o aes$(i586-y).o glue.o md5$(i586-y).o

##########################

I see in the Makefile that you do a lot of tricks to support various
kernel versions. But they all end up in a few defines for the C compiler,
which you just needs to supply in the variable LOOP_AES_CFLAGS.
[And some file massaging whaich is done before starting the build]

What I would recommend you to do is to move all your backward compatibility
stuff and general rules to a file named 'makefile'.
Then provide individual Makefiles for each kernel version:
Makefile.2.4, Makefile.2.6
Then symlink Makfile to the right one and build the module.

This would clean up your Makefile and give you correct usage in 2.6

	Sam



  reply	other threads:[~2004-04-28 20:00 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1PMQ9-5K6-3@gated-at.bofh.it>
2004-04-28 14:48 ` Linux 2.6.6-rc3 Vincent C Jones
2004-04-28 16:00   ` Sam Ravnborg
2004-04-28 17:24     ` Jari Ruusu
2004-04-28 19:08       ` Sam Ravnborg [this message]
2004-04-28 19:18       ` Vincent C Jones
     [not found] ` <1PVTx-4rY-25@gated-at.bofh.it>
     [not found]   ` <1R9hC-6rC-3@gated-at.bofh.it>
     [not found]     ` <1Rbjr-7Y5-17@gated-at.bofh.it>
     [not found]       ` <1RbW9-8sE-17@gated-at.bofh.it>
2004-05-01 23:26         ` 2.6.6-rc3: modular DVB tda1004x broken Andi Kleen
2004-05-01 23:34           ` Andrew Morton
2004-04-28  2:03 Linux 2.6.6-rc3 Linus Torvalds
2004-04-28  8:48 ` Måns Rullgård
2004-04-28  9:16 ` Florian Schirmer
2004-04-28  9:52   ` Armin Schindler
2004-04-28 11:56 ` Eyal Lebedinsky
2004-04-28 17:28 ` Maciej Soltysiak
2004-04-29  1:02 ` Craig Thomas
2004-04-29  0:59   ` CaT
2004-04-29 17:10     ` Craig Thomas
2004-04-29  2:11   ` Andrew Morton
2004-04-29 15:59     ` Craig Thomas
2004-04-29 17:01 ` Jacek Kawa
2004-04-29 17:32   ` Sam Ravnborg
2004-04-30  1:05     ` Jacek Kawa

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=20040428190855.GA4069@mars.ravnborg.org \
    --to=sam@ravnborg.org \
    --cc=jariruusu@users.sourceforge.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=vcjones@NetworkingUnlimited.com \
    /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