[SOLVED] make: no rule to make target 'modules'

Kernels & Hardware, configuring network, installing services

[SOLVED] make: no rule to make target 'modules'

Postby s0nee » 2012-02-15 17:48

Hi everyone :D

I have googled but it seems like the reason varies so I decide to ask for help here.

I am trying to compile a module called 'acpi_call' to disable my discrete graphic card, but make gives me this error :
Code: Select all
make -C /lib/modules/2.6.32-5-686/build M=/<some-dir>/acpi_call_debian modules
make[1]: Entering directory `/lib/modules/2.6.32-5-686/build'
make[1]: *** No rule to make target `modules'.  Stop.
make[1]: Leaving directory `/lib/modules/2.6.32-5-686/build'
make: *** [default] Error 2


Here is the content of Makefile
Code: Select all
obj-m := acpi_call.o

KVERSION := $(shell uname -r)
KDIR := /lib/modules/$(KVERSION)/build
PWD := $(shell pwd)

default:
   $(MAKE) -C $(KDIR) M=$(PWD) modules

clean:
   $(MAKE) -C $(KDIR) M=$(PWD) clean

load:
   -/sbin/rmmod acpi_call
   /sbin/insmod acpi_call.ko


make compiles the module on ubuntu and archlinux but it doesn't on debian.

some notes:
- I have build-essential and linux-headers properly installed
- kernel 2.6.32-5-686
- no configure or other scripts
s0nee
 
Posts: 2
Joined: 2012-02-15 17:25

Re: [SOLVED] make: no rule to make target 'modules'

Postby s0nee » 2012-02-15 23:19

ok solved.

so it turns out that previously make complained that there was no build under /lib/modules/2.6.32-5-686/, so I created a folder 'build'. Make stopped complaining about missing 'build' but that was actually why it didn't work.

I created a symlink to /lib/src/linux-headers and now make compiled the module.

Thanks for reading.
s0nee
 
Posts: 2
Joined: 2012-02-15 17:25

Re: [SOLVED] make: no rule to make target 'modules'

Postby jfursathimn » 2014-08-01 03:30

I am having the exact same problem. I'm trying to compile / install a module that looks for my /lib/modules/3.2.0-4-amd64/build folder but it doesn't exist. I'm glad to see you solved your own problem a while ago, but with this stuff I'm a bit out of my depth. Would you mind explaining in more detail about what exactly you did with a symlink to fix the problem so I can attempt the same solution?

Thanks!
jfursathimn
 
Posts: 1
Joined: 2014-08-01 03:25


Return to System configuration

Who is online

Users browsing this forum: No registered users and 14 guests

fashionable