'make' never seems to work!

Code junkies hangout here

Moderators: ChrisThornett, LXF moderators

'make' never seems to work!

Postby alloydog » Wed Aug 10, 2005 6:40 pm

I have tried on numerous occassions to 'make' a file, but I always get errors.

Here are two examples:

Code: Select all
#:/home/voyager/programmes/pc-cam_880_driver # ls
CHANGELOG  Makefile  decode-jpg.c  memory.c  zr364xx-0.60         zr364xx.c
COPYING    README    decode-jpg.h  osd.c     zr364xx-0.60.tar.gz
#:/home/voyager/programmes/pc-cam_880_driver # make
   Building zr364xx driver for 2.5/2.6 kernel.
   PLEASE IGNORE THE "Overriding SUBDIRS" WARNING
   Remember: you must have read/write access to your kernel source tree.
make -C /lib/modules/`uname -r`/build/ SUBDIRS=`pwd` modules
make: *** /lib/modules/2.6.7/build/: No such file or directory.  Stop.
make: *** [default] Error 2


and

Code: Select all
/home/voyager/programmes/pc-cam_880-0.2 # ls
COPYING  Makefile  README  app  driver  driver-2.6.diff  pccam880-0.2.tar.gz
#:/home/voyager/programmes/pc-cam_880-0.2 # make
make -C driver
make[1]: Entering directory `/home/voyager/programmes/pc-cam_880-0.2/driver'
Makefile:4: /usr/src/linux/.config: No such file or directory
make[1]: *** No rule to make target `/usr/src/linux/.config'.  Stop.
make[1]: Leaving directory `/home/voyager/programmes/pc-cam_880-0.2/driver'
make: *** [all] Error 2


what am I doing wrong?
User avatar
alloydog
LXF regular
 
Posts: 600
Joined: Thu Apr 07, 2005 7:32 pm

RE:

Postby Gordon » Wed Aug 10, 2005 8:21 pm

I presume you mean building a file from source code? These days you don't just "make" a file.

First of all start again. If your source code package is a .tar.gz file (which it seems to be from your code) then unpack it using the command

tar xvzf xxx.tar.gz

where xxx refers to the rest of the filename before the .tar.gz extension. The source code should unpack into its own directory. Use the cd command to change into this new diretory.

Now just list the files in this new directory with the ls command. If you see a README file of any kind then read this first with the command

less README

Do the same thing for any INSTALL files you see in this directory. If there are any special build procedures for the source code then these files should point them out.

If there is a file in this directory you're in called .configure then in due course you will need to run this file, BUT first try the following; run the command,

./configure --help | less

This will output the configuration options for the code to the screen. If you're happy so far then you need to run the following commands from inside the directory containing the source code;

./configure --prefix=/usr
make

and now as root type

make install

All should now be well. There are some older packages of source code out there which use different methods but these days we rarely come across them.

Hope this helps.
Gordon
Violence is the last refuge of the incompetent
User avatar
Gordon
LXF regular
 
Posts: 209
Joined: Thu Apr 07, 2005 5:01 pm
Location: Bradford, West Yorkshire

RE:

Postby nelz » Wed Aug 10, 2005 8:27 pm

Both of these error indicate you don't have the kernel sources installed. When compiling a driver as a module, the code needs access to the source code for the current kernel. Look for a kernel-source or similarly named package in your distro's package manager.
User avatar
nelz
Site admin
 
Posts: 8499
Joined: Mon Apr 04, 2005 11:52 am
Location: Warrington, UK

RE:

Postby Erin » Wed Aug 10, 2005 8:32 pm

It seems the second make attempt cannot find the kernel header files. You need to install these from your local install CD or repository. Have the ones for the kernel you are running (check this on the command line by typing 'uname -r' sans quotes. The clue was in "Makefile:4: /usr/src/linux/.config: No such file or directory".

However, you do need to read the README files first. If that doesn't make sense or you need more help, reply.

Erin
Just beneath my skin I'm screaming. Faithless::Insomnia.
Dual PIII 550 with Ubuntu [semi-bleeding].
User avatar
Erin
LXF regular
 
Posts: 141
Joined: Thu Apr 07, 2005 7:35 pm
Location: The Olde Smoke south of the River

Postby wiz » Wed Aug 10, 2005 8:32 pm

From the diff file it looks like this is going to be a kernel module so you will probably need to have the kernel source code installed in /usr/src/linux.

When you have done this once it is easy but can be a bit hairy trying to figure it out for the first time. Check which kernel you are using and then install the source code for it and try again
wiz
LXF regular
 
Posts: 119
Joined: Thu Apr 07, 2005 6:20 pm
Location: In front of a computer

Postby wiz » Wed Aug 10, 2005 8:34 pm

Hey ! the other two replies sneaked in before mine while i was doing my one finger typing.
wiz
LXF regular
 
Posts: 119
Joined: Thu Apr 07, 2005 6:20 pm
Location: In front of a computer

Postby nelz » Wed Aug 10, 2005 9:23 pm

Two finger tipping wins again!
"Insanity: doing the same thing over and over again and expecting different results." (Albert Einstein)
User avatar
nelz
Site admin
 
Posts: 8499
Joined: Mon Apr 04, 2005 11:52 am
Location: Warrington, UK

Postby Erin » Wed Aug 10, 2005 9:33 pm

One finger and a rogue cat here!
Just beneath my skin I'm screaming. Faithless::Insomnia.
Dual PIII 550 with Ubuntu [semi-bleeding].
User avatar
Erin
LXF regular
 
Posts: 141
Joined: Thu Apr 07, 2005 7:35 pm
Location: The Olde Smoke south of the River

Postby alloydog » Thu Aug 11, 2005 11:22 am

Thanks folks, that was wut I wuz needing.

Now to find the kernel source code...
User avatar
alloydog
LXF regular
 
Posts: 600
Joined: Thu Apr 07, 2005 7:32 pm

Postby comcamel » Sat Oct 15, 2005 9:12 am

i get the same problem than that, but after having a look on line, i thought that the problem was that i was using the gcc 4.0 compiler modules, things such as gimp wouldn't compile at all, however thanks for the idea of the kernel sources.
comcamel
LXF regular
 
Posts: 205
Joined: Thu Apr 07, 2005 5:35 pm


Return to Programming

Who is online

Users browsing this forum: No registered users and 1 guest