make[1]: *** No rule to make target `modules'. Stop.
Linux - HardwareThis forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Nice one, maroonbaboon. I've downloaded the headers package and emailed it to myself at home. Once I'm home from work, I'll give your advice a shot. Will the headers install themselves into the default directory in which make was searching? Or will I still need to amend the makefile?
Ok, now I'm getting a little frustrated. I copied over the proper headers and installed them with no errors using dpkg, but /lib/modules/2.6.20-15-server/build/ is still empty! What am I doing wrong?
I installed linux-headers-2.6.20-15 and then linux-headers-2.6.20-15-server (the former were a dependency of the latter according to dpkg)
I'm still getting the exact same "*** No rule to make target 'modules'. Stop." Is it possible I've done something ridiculously stupid like putting the source files in the wrong directory?
I even changed the line in Makefile from "shell uname -r" to "2.6.20-15-server"
I uninstalled and reinstalled the headers, and that appears to have taken care of my problem after I edited the KERNEL_SOURCES back to the original state. Now it seems to be working almost properly, though, the last 3 lines of output when I run make are:
Code:
!!! WARNING: Module file much too big (>1MB)
!!! Check your kernel settings or use 'strip'
*** Module rt73.ko built successfully
I'm going to poke around to try to fix this before running make install. Thanks for your help in getting over the first hurdle.
Ok, now I'm getting a little frustrated. I copied over the proper headers and installed them with no errors using dpkg, but /lib/modules/2.6.20-15-server/build/ is still empty! What am I doing wrong?
Like I suggested to bonder, the command
dpkg -L linux-headers-`uname -r`
should tell you where the package has installed the header files (assuming they match the kernel you are running, as determined by the output of uname -r).
The KERNEL_SOURCES variable in the Makefile should point to the same place. You may even be able to revert back to the original Makefile if the headers are installed.
Quote:
I installed linux-headers-2.6.20-15 and then linux-headers-2.6.20-15-server (the former were a dependency of the latter according to dpkg).
I'm not familiar with this setup. The usual place to have the kernel headers is
/lib/modules/<whatever uname -r says>/build
but I have some recollection that Ubuntu might use something different.
Quote:
Is it possible I've done something ridiculously stupid like putting the source files in the wrong directory?
Not really, the packaging system, via dpkg, decides where they go.
Quote:
I even changed the line in Makefile from "shell uname -r" to "2.6.20-15-server"
Same thing, assuming command 'uname -r' returns that string. Anyway dpkg -L will hopefully tell you where the files are and you can put it in explicitly.
Last edited by maroonbaboon; 10-02-2007 at 06:58 PM.
Reason: formatting error
Thanks again MB! I'm afraid I'm still stuck, though. dpkg -L gave me a long list of directories, all but the last beginning /usr/src/linux-headers-2.6.20-15-server. The last one in the list was /lib/modules/2.6.20-15-server/build.
However, the /build directory is still empty. That really shouldn't be, should it? I didn't receive a single error message or see anything suspicious when I installed both header packages, which lead me to believe they installed without a hitch, but shouldn't they have populated the /build directory?
That 'build' directory might be a symbolic link (i.e. a pointer to another directory). If you run
ls -l /lib/modules/2.6.20-15-server/build
it will show if it is a link (look out for the '->'). The directory you are looking for should contain (at least) as subdirectory called 'include/linux'. This directory is what KERNEL_SOURCES should be set to. It may be that 'build' is a just a link to this. That's the setup on my Debian system.
All this apparent complexity is in fact an attempt to get compatibility between different distros and kernel versions, but when something breaks it does make it more difficult to see what is wrong.
That 'build' directory might be a symbolic link (i.e. a pointer to another directory). If you run
ls -l /lib/modules/2.6.20-15-server/build
it will show if it is a link (look out for the '->'). The directory you are looking for should contain (at least) as subdirectory called 'include/linux'.
Ok, I ran that command and the only output was "total 0" so /build really is empty. I can tell you that there is an instance of the /include/linux directory within both of the headers (linux-headers-2.6.20-15 and linux-headers-2.6.20-15-server) directories in /usr/src.
I should specify now that I'm trying to install a different driver than Bonder, and my Makefile is quite different.
The first five lines read (as I have already amended):
I figure they're the most pertinent to the thread. If I've understood you so far, the KDIR is instructing make where to search for the /include/linux directory, so should I change that line to read /usr/src/linux-headers-2.6.20-15-server/ ? The KMISC line appears to be correct as I've checked that directory exists and is indeed full of drivers (I assume .ko files are drivers)
I genuinely appreciate all your help so far; do you think you can see this through with me?
Nice to see you are so determined! Yes, it looks like you should change KDIR as you suggest (forget the '/' at the end tho'). This is all assuming that the output of 'uname -r' really is 2.6.20-15-server. You can check the others by opening a terminal and entering (just cut and paste onto the command line)
KVER=2.6.20-15-server
echo 2$(shell echo $(KVER) | sed -ne 's/^2\.[4]\..*/4/p')x
This should show you what KFLAG actually expands to. Same with the others.
Anyway, it looks OK to me. Post the error message if it fails again.
Hi,
sorry to resurrect such an old thread, but was using this to try to install a Realtek R8168 driver under RedHat EL4 U5 and was getting the same error message.
I tried lots of things with the Makefile etc, but in the end it turned out that the path to the source files for the driver contained a space (I had copied the directory structure from a Windows machine) - once I renamed the directory, losing the space, the drivers compiled straight away.
Hopefully this'll help someone else at some stage.
All the best,
Kevin.
well I'm glad you did, as I hadn't noticed it was old till you said that at the end. I'm having exactly the same sorts of troubles with my system and a NIC.
I'm spending days (not hours) on this, and its making me wonder when I ever had this sort of problem with Apple -> DOS -> Win 3.1 -> Win anything.
I am experiencing this for the first time. I have done a couple of (would kernel re-links be accurate?) these before just following doc, this is the first problem.
Is the reason for the error messages due to the fact that the LINUX
versions are different?
I see all of the suggestions in the previous posts. I will have to figure out how to display headers and some of the other stuff before I can tackle fixing it.
make -C /usr/src/linux-2.6.16.60-0.34-obj/x86_64/smp
SUBDIRS=/usr/vpn/vpnclient modules
make[1]: Entering directory
`/usr/src/linux-2.6.16.60-0.34-obj/x86_64/smp'
make[1]: *** No rule to make target `modules'. Stop.
make[1]: Leaving directory
`/usr/src/linux-2.6.16.60-0.34-obj/x86_64/smp'
make: *** [default] Error 2
Failed to make module "cisco_ipsec.ko".
I'm a Transplanted z/VM-z/OS system programmer so this is all new.
I too was blundering around in the dark. I'd tried a mkdir for ../build, which hadn't worked, then I found I need to install the headers. That didn't fix it either. After discovering that ..build is a symlink, I did the following
rmdir the empty ../build directory I created
apt purged the headers
apt installed the headers
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.