I've been trying to compile this module forever. It's the 'lm' part of the gatos driver. When I try to run the makefile, it gives me this error:
include/linux/pci.h: In function ‘pci_register_driver’:
include/linux/pci.h:595: error: ‘KBUILD_MODNAME’ undeclared
here is the makefile:
######### makefile #########
ifneq ($(KERNELRELEASE),)
KM_OBJS=km.o km_v4l.o km_memory.o radeon.o mach64.o rage128.o
KM_API_OBJS=km_api.o km_api_data.o km_memory.o
km_drv-objs := ${KM_OBJS}
km_api_drv-objs := ${KM_API_OBJS}
obj-m += km_drv.o
obj-m += km_api_drv.o
EXTRA_CFLAGS += -DLINUX_2_6
else
KDIR := /lib/modules/$(shell uname -r)/build
PWD := $(shell pwd)
all:
$(MAKE) -C $(KDIR) M=$(PWD) modules
clean:
$(MAKE) -C $(KDIR) M=$(PWD) clean
install:
$(MAKE) -C $(KDIR) M=$(PWD) modules_install
######### end of makefile #########
Here is the output of 'make V=1'
make -f scripts/Makefile.build obj=/root/Desktop/km
gcc -m32 -Wp,-MD,/root/Desktop/km/.km_memory.o.d -nostdinc -isystem /usr/lib/gcc/i386-redhat-linux/4.1.2/include -D__KERNEL__ -Iinclude -include include/linux/autoconf.h -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common -Os -pipe -msoft-float -mregparm=3 -freg-struct-return -mpreferred-stack-boundary=2 -march=i686 -mtune=generic -mtune=generic -ffreestanding -maccumulate-outgoing-args -DCONFIG_AS_CFI=1 -DCONFIG_AS_CFI_SIGNAL_FRAME=1 -Iinclude/asm-i386/mach-generic -Iinclude/asm-i386/mach-default -fomit-frame-pointer -g -fno-stack-protector -Wdeclaration-after-statement -Wno-pointer-sign -DLINUX_2_6 -DMODULE -D"KBUILD_STR(s)=#s" -D"KBUILD_BASENAME=KBUILD_STR(km_memory)" -c -o /root/Desktop/km/.tmp_km_memory.o /root/Desktop/km/km_memory.c
I thought the 'obj-m +=' declared the KBUILD_MODNAME varable, but I really don't understand this kbuild stuff. I'm running fedora core 7 (2.6.21). Thanks for readin![]()


Reply With Quote
But I'm getting some success with putting the line
