LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Cannot Make (https://www.linuxquestions.org/questions/linux-newbie-8/cannot-make-365698/)

disc0tech 09-21-2005 03:50 PM

Cannot Make
 
Hi,

Firstly, when I try and type an apostrophe or slash in this form, it opens the firefox find bar. Which is a bit wierd.

Secondly, I am currently installing Ubuntu on a desktop to try and decide whether to switch to linux as a desktop slash developer machine.

I am installing a driver for a wireless card, and have extracted everything and Im trying to run a make command with no parameters, in the correct directory. I have seen a number of faqs and how tos giving instructions for the same version of the driver and sometimes the same distro. However everytime I run make i get:

Entering directory xxxxx
No rule to make target <apos>modules<apos>. Stop.
Leaving directory xxxxx
rt2500.ko failed to build!
[modules] Error1

I assume something must be wrong in my environment, but I have been struggling with this for hours, any help appreciated!!

Thanks
Adam

tkedwards 09-21-2005 10:58 PM

Quote:

Firstly, when I try and type an apostrophe or slash in this form, it opens the firefox find bar. Which is a bit wierd.
Yeah I occaisonally get this happen in Firefox on Linux. I think its a bug because it only happens sometimes, but its really weird.

Quote:

Secondly, I am currently installing Ubuntu on a desktop to try and decide whether to switch to linux as a desktop slash developer machine.

I am installing a driver for a wireless card, and have extracted everything and Im trying to run a make command with no parameters, in the correct directory. I have seen a number of faqs and how tos giving instructions for the same version of the driver and sometimes the same distro. However everytime I run make i get:

Entering directory xxxxx
No rule to make target <apos>modules<apos>. Stop.
Leaving directory xxxxx
rt2500.ko failed to build!
[modules] Error1
Looks like its already compiled if its a .ko file. Try running these commands as root to install it:
Code:

install -m 644 rt2500.ko /lib/modules/`uname -r`/kernel/drivers/rt2500.ko
/sbin/depmod -a
modprobe rt2500


Dark_Helmet 09-21-2005 11:26 PM

Yeah, I've had problems with the single quote (') and the forward slash (/) too. I think it has something to do with page rendering, because it would fix itself (sometimes) by manually clicking to reload a page. I don't run across it much anymore. It also seemed to happen when I had many tabs open and the browser had been running for a long period of time.

Anyway, about the make problem. Well, I don't think it's been compiled since it complains there's no rule for "modules". I don't have the docs, so I can't be certain, but here's my guess. Since this is a driver, you need to copy the source into the kernel source tree's modules sub-directory. There may be instructions on how to add the driver to "menuconfig" or other kernel config options. It may be as simple as modifying the kernel config file to say something like "DRIVER_NAME YES". Then, when you go to compile the kernel, there are hooks in place that tell it to compile the source files you copied over. Make sense? Don't take my word for it though, read the documentation carefully. The "modules" target is common from the pre-2.6 days where the routine to compile a kernel was something like:
Code:

make mrproper
make menuconfig
make deps
make bzImage
make modules
make modules_install

It's been a while, so that may be off... Anyway, you get the idea.

disc0tech 09-22-2005 03:29 AM

Thanks. I tried running the install command an it didn't like that 'cannot stat rt2500.ko'. I guess it isn't installed.

The documentation really only says go to ./rt2500...../Module and type make. Also the Ubuntu Wiki has instructions for this if you search for rt2500 (I can't post URLs in my first few posts).

Dark_Helmet - you suggest copying to the Modules subdirectory of the source tree and recompiling the kernel. Under /usr/src I have the following directories

linux-headers-2.6.10-5
linux-headers-2.6.10-5-386
linux-headers-2.6.10-5-k7
linux-patches
linux-source-2.6.10
rpm

I did find . -name modules and couldn't find anything, although there is a <headers directors>/include/config/module?

Thanks
Adam

Dark_Helmet 09-22-2005 03:44 AM

No that doesn't sound right... My response is probably a red herring.

What driver for which wireless card, and where did you get it? I'll download a copy and take a look.

tkedwards 09-22-2005 03:55 AM

Not sure if this will help but have you just tried
Code:

su -
modprobe rt2500

. Many distros ship with common modules like this included, I just tried it then on Mandriva2005LE and it worked - maybe its included by default on ubuntu too.

disc0tech 09-22-2005 03:59 AM

Quote:

Originally posted by tkedwards
Not sure if this will help but have you just tried
Code:

su -
modprobe rt2500

. Many distros ship with common modules like this included, I just tried it then on Mandriva2005LE and it worked - maybe its included by default on ubuntu too.

No it isn't - thanks.

disc0tech 09-22-2005 04:02 AM

Quote:

Originally posted by Dark_Helmet
No that doesn't sound right... My response is probably a red herring.

What driver for which wireless card, and where did you get it? I'll download a copy and take a look.

Thanks, I am using an EDIMAX card EW-7128g. This, according to the ndiswrapper wiki, uses a RaLink RT2500 chipset. I have been following the instructions here: https://wiki.ubuntu.com/Rt2500Wirele...t=%28rt2500%29


Cheers!

Dark_Helmet 09-22-2005 04:44 AM

Okeydokey... I didn't have any problems compiling, so I'll give the commands I issued exactly.

First, I downloaded rt2500-1.1.0-b2.tar.gz from the reference link in the wiki page you provided and saved it into ${HOME}/temp. From an xterm I then did the following:
Code:

$ cd ~/temp
$ mkdir wireless
$ cd wireless
$ tar xvzf ~/temp/rt2500-1.1.0-b2.tar.gz
<<lots of output omitted>>
$ cd rt2500-1.1.0/Module
$ make
make[1]: Entering directory `/usr/src/linux-2.6.11.8'
  CC [M]  /home/DH/temp/wireless/rt2500-1.1.0/Module/rtmp_main.o
  CC [M]  /home/DH/temp/wireless/rt2500-1.1.0/Module/mlme.o
  CC [M]  /home/DH/temp/wireless/rt2500-1.1.0/Module/connect.o
  CC [M]  /home/DH/temp/wireless/rt2500-1.1.0/Module/sync.o
  CC [M]  /home/DH/temp/wireless/rt2500-1.1.0/Module/assoc.o
  CC [M]  /home/DH/temp/wireless/rt2500-1.1.0/Module/auth.o
  CC [M]  /home/DH/temp/wireless/rt2500-1.1.0/Module/auth_rsp.o
  CC [M]  /home/DH/temp/wireless/rt2500-1.1.0/Module/rtmp_data.o
  CC [M]  /home/DH/temp/wireless/rt2500-1.1.0/Module/rtmp_init.o
  CC [M]  /home/DH/temp/wireless/rt2500-1.1.0/Module/sanity.o
  CC [M]  /home/DH/temp/wireless/rt2500-1.1.0/Module/rtmp_wep.o
  CC [M]  /home/DH/temp/wireless/rt2500-1.1.0/Module/wpa.o
  CC [M]  /home/DH/temp/wireless/rt2500-1.1.0/Module/md5.o
  CC [M]  /home/DH/temp/wireless/rt2500-1.1.0/Module/rtmp_tkip.o
  CC [M]  /home/DH/temp/wireless/rt2500-1.1.0/Module/rtmp_info.o
  CC [M]  /home/DH/temp/wireless/rt2500-1.1.0/Module/eeprom.o
  LD [M]  /home/DH/temp/wireless/rt2500-1.1.0/Module/rt2500.o
  Building modules, stage 2.
  MODPOST
  CC      /home/DH/temp/wireless/rt2500-1.1.0/Module/rt2500.mod.o
  LD [M]  /home/DH/temp/wireless/rt2500-1.1.0/Module/rt2500.ko
make[1]: Leaving directory `/usr/src/linux-2.6.11.8'

Ok, so that leads me to ask this question: did you install/download the kernel source from before? The "sudo" command listed? What's happening is, they want the compiler to use some of the information from your kernel to properly compile the module. That's why you see the "Entering directory `/usr/src/linux-2.6.11.8'" in my output; that's where my kernel source exists, and they rely on the Makefile inside the kernel source to compile the module.

The "no rule" error you're getting is a strong indication that the Makefile is corrupt or doesn't exist. If it doesn't exist, it's likely you don't have the kernel source installed on the system. So check into that, and see where you stand.

disc0tech 09-22-2005 05:29 AM

In Synaptic (the ubuntu package mgr) I can see that the following are installed:

linux-source-2.6.10 - Linux kernel source for version...
linux-tree
linux-tree-2.6.10

However - my kernel version is 2.6.10-5-k7.

In the makefile I have now hardcoded the directories to match the version numbers. So my KERNDIR is /usr/src/linux-source-2.6.10 (I have checked there is a Makefile in here).

My MODDIR is /lib/modules/2.6.10-5-k7/extra.

Now when I run make I get output! We have progress, houston :)

Unfortunately I get hundreds of warnings and errors, so something still is not right. The errors run to a size larger than the buffer so I can't see the first few. It looks like a mix of unknown variables and syntax errors...so:

1) Can I pipe the make output to a file so I can see the start? I tried make > make.log but it only gets 4/5 lines that are output with the prefix make:
2) Is this likely to be to do with the difference in version between 2.6.10 and 2.6.10-5-k7?

Cheers - Adam

disc0tech 09-22-2005 05:45 AM

OK, I managed to see the earlier msgs by pressing CTRL-C straight after make.

The first errors are:

Entering directory /usr/src/linux-source-2.6.10
Makefile:484 .config: No such file or directory
CC [M] /home/adam/rt2500-1.1.0-b3/Module/rtmp_main.o
In file included from /home/adam/rt2500-1.1.0-b3/Module/rt_config.h:58,
/home/adam/rt2500-1.1.0-b3/Module/rtmp_main.c:50:
include/linux/config.h:4:28: linux/autoconf.h
(etc)

Line 484 is an endif statement, which is a little odd!

Dark_Helmet 09-22-2005 06:02 AM

There shouldn't be any significant difference between 2.6.10 and 2.6.10-5-k7. Anything after the third number (10 in this case) is called the "EXTRAVERSION" and is a user-supplied add-on to the kernel version. It's located in the top level Makefile of the kernel source tree, and it's there for people to modify when compiling the kernel with a new set of configuration options so they can keep track of which kernel has what options, etc.

You say line 484 is an endif. Does it's matching if contain a reference to the .config file? It might be acting loopy because the Makefile may have an underlying assumption that the .config file exists.

The .config file is created by whatever utility is used to configure the kernel (I think). The common ones are "make menuconfig", "make xconfig", and I think there are even qt and gtk based config utilities shipped with the kernel source. Anyway, those .config files contain information regarding your kernel's selected options for compile. There's something in that file needed for compilation. Sooooo, you'll probably need to find or create one. Before trying to make one, see if there's any documentation that says where you might find the standard configs used for the stock kernels with your distribution. If you can find it, you can probably use it to recreate the other .config files. My guess would be to start up menuconfig, load the stock kernel config, save, and exit.

I wish I could help more, but Houston is getting very, very tired :)

disc0tech 09-22-2005 06:36 AM

OK, thanks!

I ran make config, and now make modules works! Presumably I now have the .config file...

Thanks for your help!


All times are GMT -5. The time now is 05:14 PM.