Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

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

Linux Kernel, Network, and Services configuration.
Post Reply
Message
Author
s0nee
Posts: 2
Joined: 2012-02-15 17:25

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

#1 Post by s0nee »

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'

#2 Post by s0nee »

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.

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

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

#3 Post by jfursathimn »

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!

Post Reply