Hi Joe,
Joe Nahmias wrote:
On Sat, Aug 11, 2007 at 01:14:26PM +0200, Harald Dunkel wrote:
Sorry to say, but it still doesn't work for me:
make[3]: Entering directory `/usr/src/modules/omfs'
/usr/bin/make -C /lib/modules/2.6.22.2/build M=/usr/src/modules/omfs clean
make: Entering an unknown directory
make: *** /lib/modules/2.6.22.2/build: No such file or directory. Stop.
[snip]
Did I mention that the destination kernel is not installed
yet?
That symlink is supposed to be supplied not by the kernel package, but
by the kernel header package. For example:
Sure, but the kernel header package is not installed yet, either.
It is derived from the same kernel source tree. The symlink doesn't
exist when the omfs module is built, i.e. the line
KERNELDIR ?= /lib/modules/$(KVERS)/build
in omfs' Makefile doesn't work for make-kpkg, even if KVERS
is defined.
Maybe the attached makefile stolen from the nvidia kernel module
helps? It shows how to compute the KERNEL_SOURCES and
KERNEL_HEADERS variables for both make-kpkg and m-a.
Regards
Harri
#
# Top level makefile for the NVIDIA kernel module; this file selects
# which "real" Makefile should actually be used to build the kernel
# module (either the "old" nvidia Makefile, or the kbuild makefile),
# and then passes the target on to that Makefile.
#
KERNEL_MODLIB := /lib/modules/$(shell uname -r)
ifndef SYSSRC
ifdef SYSINCLUDE
KERNEL_HEADERS := $(SYSINCLUDE)
KERNEL_SOURCES := $(KERNEL_HEADERS)/..
else
KERNEL_SOURCES := $(shell test -d $(KERNEL_MODLIB)/source && echo
$(KERNEL_MODLIB)/source || echo $(KERNEL_MODLIB)/build)
KERNEL_HEADERS := $(KERNEL_SOURCES)/include
endif
else
KERNEL_SOURCES := $(SYSSRC)
KERNEL_HEADERS := $(KERNEL_SOURCES)/include
endif
ifndef SYSOUT
ifeq ($(KERNEL_SOURCES), $(KERNEL_MODLIB)/source)
KERNEL_OUTPUT := $(KERNEL_MODLIB)/build
else
KERNEL_OUTPUT := $(KERNEL_SOURCES)
endif
else
#
# Support separate KBUILD output directories; SYSOUT
# needs to reflect the correct KBUILD_OUTPUT.
#
KERNEL_OUTPUT := $(SYSOUT)
endif
CC ?= cc
HOST_CC ?= $(CC)
CONFTEST := sh ./conftest.sh "$(CC)" "$(HOST_CC)" $(KERNEL_SOURCES)
$(KERNEL_OUTPUT)
.PHONY: select_makefile
select_makefile:
@ $(CONFTEST) cc_sanity_check full_output && \
$(CONFTEST) select_makefile full_output
default: module
module nvidia.o nvidia.ko install nv-linux.o module-install package-install
print-module-filename: select_makefile
@ $(MAKE) --no-print-directory -f Makefile $@
clean:
@ if [ -f Makefile ]; then \
$(MAKE) --no-print-directory -f Makefile $@; \
fi; \
rm -f Makefile