[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Missing Makefile



On 8/2/2013 4:01 PM, Tom H wrote:


This is on sid, not wheezy (I don't have a wheezy box with compilation
tools installed).


[root@localhost:/usr/src/jstuckle]# aptitude search -F '%c %p %v %V'
linux-image-3
i linux-image-3.10-1-amd64 3.10.3-1       3.10.3-1
p linux-image-3.10-1-amd64-dbg <none>         3.10.3-1

[root@localhost:/usr/src/jstuckle]# aptitude search -F '%c %p %v %V'
linux-headers-3
p linux-headers-3.10-1-all <none>         3.10.3-1
p linux-headers-3.10-1-all-amd64 <none>         3.10.3-1
i linux-headers-3.10-1-amd64 3.10.3-1       3.10.3-1
i linux-headers-3.10-1-common 3.10.3-1       3.10.3-1

[root@localhost:/usr/src/jstuckle]# aptitude search -F '%c %p %v %V'
linux-kbuild-3
i linux-kbuild-3.10 3.10-2         3.10-2


[root@localhost:/usr/src/jstuckle]# ls
/usr/src/linux-headers-3.10-1-common/scripts
basic          depmod.sh                 genksyms Makefile.build
makelst          namespace.pl
bin2c          gcc-goto.sh                 kallsyms Makefile.clean
mksysmap          patch-kernel
checkincludes.pl  gcc-version.sh             Kbuild.include
Makefile.host     mkuboot.sh      pnmtologo
checkstack.pl      gcc-x86_32-has-stack-protector.sh  kconfig
Makefile.lib      mkversion      setlocalversion
checkversion.pl   gcc-x86_64-has-stack-protector.sh kernel-doc
Makefile.modinst  mod          ver_linux
conmakehash      gen_initramfs_list.sh             Lindent
Makefile.modpost  module-common.lds

[root@localhost:/usr/src/jstuckle]# stat
/usr/src/linux-headers-3.10-1-common/scripts
File: ‘/usr/src/linux-headers-3.10-1-common/scripts’ ->
‘../../lib/linux-kbuild-3.10/scripts’
<snip>


I can compile a basic module using your Makefile. Can you?


[root@localhost:/usr/src/jstuckle]# ls
Makefile  mymodule.c

[root@localhost:/usr/src/jstuckle]# cat Makefile
obj-m = mymodule.o
KVERSION = $(shell uname -r)
all:
     make -C /lib/modules/$(KVERSION)/build M=$(PWD) modules
clean:
     make -C /lib/modules/$(KVERSION)/build M=$(PWD) clean

[root@localhost:/usr/src/jstuckle]# cat mymodule.c
#include <linux/module.h>
#include <linux/kernel.h>
MODULE_LICENSE("GPL");
int init_module(void)
{
     printk(KERN_ALERT "Hello world\n");
     return 0;
}
void cleanup_module(void)
{
     printk(KERN_ALERT "Goodbye world\n");
}

[root@localhost:/usr/src/jstuckle]# make
make -C /lib/modules/3.10-1-amd64/build M=/usr/src/jstuckle modules
make[1]: Entering directory `/usr/src/linux-headers-3.10-1-amd64'
CC [M]  /usr/src/jstuckle/mymodule.o
Building modules, stage 2.
MODPOST 1 modules
CC      /usr/src/jstuckle/mymodule.mod.o
LD [M]  /usr/src/jstuckle/mymodule.ko
make[1]: Leaving directory `/usr/src/linux-headers-3.10-1-amd64'

[root@localhost:/usr/src/jstuckle]# ls
Makefile  modules.order  Module.symvers  mymodule.c  mymodule.ko
mymodule.mod.c  mymodule.mod.o  mymodule.o

[root@localhost:/usr/src/jstuckle]# insmod mymodule.ko

[root@localhost:/usr/src/jstuckle]# grep mymodule /proc/modules
mymodule 12388 0 - Live 0xffffffffa02e5000 (PO)



Tom,

Thanks for trying to help.

No, the make fails with a missing Makefile, as indicated in my original post.


Reply to: