Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id ; Mon, 10 Jun 2002 10:31:44 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id ; Mon, 10 Jun 2002 10:31:43 -0400 Received: from chaos.physics.uiowa.edu ([128.255.34.189]:30382 "EHLO chaos.physics.uiowa.edu") by vger.kernel.org with ESMTP id ; Mon, 10 Jun 2002 10:31:43 -0400 Date: Mon, 10 Jun 2002 09:31:42 -0500 (CDT) From: Kai Germaschewski X-X-Sender: kai@chaos.physics.uiowa.edu To: John Levon cc: linux-kernel@vger.kernel.org Subject: Re: External compilation In-Reply-To: <20020609142602.GA77496@compsoc.man.ac.uk> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org On Sun, 9 Jun 2002, John Levon wrote: > Is there any good example code for compiling a kernel module > externally, that works for modversions etc. on 2.2, 2.4, and 2.5, > and does the right thing (including Rules.make) ? Well, you need the source for the kernel you're building the module for, it needs to be configured and "make dep" must have been run (for module versions). (You normally can find it by looking into /lib/modules/`uname -r`/kernel for the currently running kernel) Put your module source in some directory, and add a Makefile like obj-m := my_module.o include $(TOPDIR)/Rules.make cd into the kernel source and run make SUBDIRS=/path/to/your/module modules --Kai - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/