After UPDATE, I get: "no rule to build the target" running MAKE, why?

8,683

The clue to this question is this part of the error message:

make[2]: * No rule to build the target « arch/x86/tools/relocs.c », needed for « arch/x86/tools/relocs ». Stop.

The makefile is looking for a code module called relocs.c.

Now, code modules don't normally exist in the kernel headers. You need to extract the kernel source first and then the Makefile has something to chew on.

Let's do this.

Navigate to your kernel source folder:

cd /usr/src/linux-source-[version]

In your case [version] kernel version is 3.2.0.

List the contents of the folder. You should see a file in there called linux-source-[version].tar.bz2. N.B. as before replace [version] with your kernel version number.

If you don't, install the source:

sudo apt-get install linux-source

Now extract the source:

sudo tar -jxvf linux-source-[version].tar.bz2

Then you should be able to complete your compilation.

Share:
8,683

Related videos on Youtube

Boris
Author by

Boris

Updated on September 18, 2022

Comments

  • Boris
    Boris over 1 year

    I frequently run the Ubuntu updates-manager enter image description here,
    and after that, every time, I need to do a make to re-install my TV tuner driver (like described in here)

    But that time, make stops with errors:
    Following error messages are translated from french

    $ make
    make -C /lib/modules/3.2.0-53-generic-pae/build M= modules
    make[1]: entering in folder « /usr/src/linux-headers-3.2.0-53-generic-pae »
    make[2]: *** No rule to build the target « arch/x86/tools/relocs.c », needed for « arch/x86/tools/relocs ». Stop.
    make[1]: *** [archscripts] Erreur 2
    make[1]: exiting folder « /usr/src/linux-headers-3.2.0-53-generic-pae »
    make: *** [all] Erreur 2
    

    How can I solve this error please ?


    For information:

    • Ubuntu version is 12.04 (precise)
    • Kernel Linux is 3.2.0-53-generic-pae
    • Content of /usr/src/linux-headers-3.2.0-53-generic/arch/x86/
      is similar to /usr/src/linux-headers-3.2.0-52-generic/arch/x86/

    • content of folder /usr/src/linux-source-3.2.0 is

      $ ls -la /usr/src/linux-source-3.2.0
      total 78020
      drwxr-xr-x  4 root root     4096 sept. 21 08:44 .
      drwxr-xr-x 74 root root     4096 sept. 21 22:44 ..
      drwxr-xr-x 10 root root     4096 sept. 21 08:44 debian
      drwxr-xr-x  8 root root     4096 sept. 21 08:44 debian.master
      -rw-r--r--  1 root root 79874365 aug.  23 00:11 linux-source-3.2.0.tar.bz2
      

      and

      $ find /usr/src/linux-source-3.2.0 -name "relocs.c"
      

      returns nothing

  • nilsonneto
    nilsonneto over 10 years
    @Boris - if you just got a kernel update then yes, you'll need to recompile again. Check that you are still running 3.2.0.53 i.e. uname -r
  • nilsonneto
    nilsonneto over 10 years
    @Boris - please join me in the general room - chat.stackexchange.com/rooms/201/ask-ubuntu-general-room
  • Boris
    Boris over 10 years
    just to confirm your though: make problem is soled and TV Tuner driver are well installed with old kernel 3.2.0-52-generic