LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices

Reply
 
LinkBack Search this Thread
Old 02-13-2004, 11:34 AM   #1
kmack2001
LQ Newbie
 
Registered: Feb 2004
Posts: 7

Rep: Reputation: 0
*** No rule to make target `modules'. Stop.


I am trying to build a hello world program for an external linux kernel module. I am getting the following results. Can someone help me??

@linux:~/projects/drivers> make -C /lib/modules/2.4.21-166-default/build SUBDIRS=$PWD modules
make: Entering directory `/usr/src/linux-2.4.21-166-include/default'
make -C /home/mac/projects/drivers CFLAGS="-D__KERNEL__ -I/usr/src/linux-2.4.21-166-include/default/include -Wall -Wstrict-prototypes -Wno-trigraphs -O2 -fno-strict-aliasing -fno-common -fomit-frame-pointer -fno-unit-at-a-time -pipe -msoft-float -mpreferred-stack-boundary=2 -DMODULE -DMODVERSIONS -include /usr/src/linux-2.4.21-166-include/default/include/linux/modversions.h" MAKING_MODULES=1 modules
make[1]: Entering directory `/home/mac/projects/drivers'
make[1]: *** No rule to make target `modules'. Stop.
make[1]: Leaving directory `/home/mac/projects/drivers'
make: *** [_mod_/home/mac/projects/drivers] Error 2
make: Leaving directory `/usr/src/linux-2.4.21-166-include/default'
@linux:~/projects/drivers>
 
Old 02-13-2004, 11:46 AM   #2
deloptes
Member
 
Registered: Feb 2004
Location: AT
Distribution: debian etch and SUSE 10.2
Posts: 123

Rep: Reputation: 15
it's clear that you are missing a rule in your Makefile in the `/home/mac/projects/drivers' directory, I think you should have a look in your Makefiles

I would put this driver in /usr/src/linux/drivers/misc as this is what the makefile says
#
# Makefile for misc devices that really don't fit anywhere else.
#
# Note! Dependencies are done automagically by 'make dep', which also
# removes any old dependencies. DON'T put your own dependencies here
# unless it's something special (ie not a .c file).
#
# Note 2! The CFLAGS definitions are now inherited from the
# parent makes..
#

O_TARGET := misc.o

include $(TOPDIR)/Rules.make

fastdep:

r3gard5
 
Old 02-13-2004, 11:48 AM   #3
sirphoenix
Member
 
Registered: Aug 2003
Location: Old Europe
Distribution: Debian Sid/Sarge
Posts: 37

Rep: Reputation: 15
hi there. no idea about compiling. but i do get this error if i am trying to compile my kernel in a wrong way. for explample if i type "make menuconfigggggg" instead of "make menuconfig"
it will say smth like "no rule to make "menuconfigggggg" (translated into english)

does this help?
 
Old 02-13-2004, 12:02 PM   #4
kmack2001
LQ Newbie
 
Registered: Feb 2004
Posts: 7

Original Poster
Rep: Reputation: 0
Could this be an installation problem?? I am using Suse 9.0. It did not come with the kernel source code. (Took me a while to figure that out).

Here is my makefile and hello file included.
makefile:
obj-m: hello.o

hello.c
#include <linux/init.h>
#include <linux/module.h>
#include <linux/kernel.h>

int hello_init(void) {printk("<1>Hello, world\n"); return 0; }
void hello_exit(void) { printk("<1>Goodbye cruel world\n"); }

module_init(hello_init);
module_exit(hello_exit);


----------------------------------------------------------------------
*** No rule to make target `modules'. Stop. ( post #1)

I am trying to build a hello world program for an external linux kernel module. I am getting the following results. Can someone help me??

@linux:~/projects/drivers> make -C /lib/modules/2.4.21-166-default/build SUBDIRS=$PWD modules
make: Entering directory `/usr/src/linux-2.4.21-166-include/default'
make -C /home/mac/projects/drivers CFLAGS="-D__KERNEL__ -I/usr/src/linux-2.4.21-166-include/default/include -Wall -Wstrict-prototypes -Wno-trigraphs -O2 -fno-strict-aliasing -fno-common -fomit-frame-pointer -fno-unit-at-a-time -pipe -msoft-float -mpreferred-stack-boundary=2 -DMODULE -DMODVERSIONS -include /usr/src/linux-2.4.21-166-include/default/include/linux/modversions.h" MAKING_MODULES=1 modules
make[1]: Entering directory `/home/mac/projects/drivers'
make[1]: *** No rule to make target `modules'. Stop.
make[1]: Leaving directory `/home/mac/projects/drivers'
make: *** [_mod_/home/mac/projects/drivers] Error 2
make: Leaving directory `/usr/src/linux-2.4.21-166-include/default'
@linux:~/projects/drivers>
 
Old 02-14-2004, 10:47 AM   #5
kmack2001
LQ Newbie
 
Registered: Feb 2004
Posts: 7

Original Poster
Rep: Reputation: 0
The problem ended up being that I was using instructions for build in 2.6 kernel when I was using a 2.4 kernel. I am still having other problems. I am getting "error unknown processor family" error now.

I also had to run
make mrproper
make cloneconfig
make dep
 
Old 02-15-2004, 07:05 AM   #6
deloptes
Member
 
Registered: Feb 2004
Location: AT
Distribution: debian etch and SUSE 10.2
Posts: 123

Rep: Reputation: 15
Great, I think you didn't set this option in the config. Start again make xconfig or menuconfig and look for Processor type and features - you click the first field and set your CPU-type.

you can also look in the .config file and uncomment one option corresponding to you cpu

# Processor type and features
#
# CONFIG_M386 is not set
# CONFIG_M486 is not set
# CONFIG_M586 is not set
# CONFIG_M586TSC is not set
# CONFIG_M586MMX is not set
# CONFIG_M686 is not set
CONFIG_MPENTIUMIII=y
# CONFIG_MPENTIUM4 is not set
# CONFIG_MK6 is not set
# CONFIG_MK7 is not set
# CONFIG_MK8 is not set
# CONFIG_MELAN is not set
# CONFIG_MCRUSOE is not set
# CONFIG_MWINCHIPC6 is not set
# CONFIG_MWINCHIP2 is not set
# CONFIG_MWINCHIP3D is not set
# CONFIG_MCYRIXIII is not set
# CONFIG_MVIAC3_2 is not set

If it doesn't help I suggest you start over.

# cd /usr/src
# cp linux/.config .
# rm -rf linux......
# tar xjvf linux-.......
# ln -s linux-......... linux

# cd linux && make xconfig
(or menuconfig)

# make dep && make bzImage
(or zImage)
 
Old 02-15-2004, 08:24 AM   #7
kmack2001
LQ Newbie
 
Registered: Feb 2004
Posts: 7

Original Poster
Rep: Reputation: 0
I started a new thread w/ the following heading:

"question on usr/include/asm/module.h "

Below is the context, to continue this thread. This is what I found.
(Sorry for duplication)

SUSE 9.0 kernel 2.4.21-144 w/2.4.21-166 kernel-source

I am trying to compile a linux kernel module (hello world). I am getting an error unknown processor.

I noticed that in "/usr/src/linux/arch/i386/defconfig"

CONFIG_M586NOCX8=y

is set.

However, in "/usr/inlcude/asm/module.h" as seen below that option
is not available. Does any one know ehich MODULE_PROC_FAMILY to use??
how do I get around this??

#ifdef __KERNEL__

#ifdef CONFIG_M386
#define MODULE_PROC_FAMILY "386 "
#elif defined CONFIG_M486
#define MODULE_PROC_FAMILY "486 "
#elif defined CONFIG_M586
#define MODULE_PROC_FAMILY "586 "
#elif defined CONFIG_M586TSC
#define MODULE_PROC_FAMILY "586TSC "
#elif defined CONFIG_M586MMX
#define MODULE_PROC_FAMILY "586MMX "
#elif defined CONFIG_M686
#define MODULE_PROC_FAMILY "686 "
#elif defined CONFIG_MPENTIUMII
#define MODULE_PROC_FAMILY "PENTIUMII "
#elif defined CONFIG_MPENTIUMIII
#define MODULE_PROC_FAMILY "PENTIUMIII "
#elif defined CONFIG_MPENTIUM4
#define MODULE_PROC_FAMILY "PENTIUM4 "
#elif defined CONFIG_MK6
#define MODULE_PROC_FAMILY "K6 "
#elif defined CONFIG_MK7
#define MODULE_PROC_FAMILY "K7 "
#elif defined CONFIG_MK8
#define MODULE_PROC_FAMILY "K8 "
#elif defined CONFIG_MELAN
#define MODULE_PROC_FAMILY "ELAN "
#elif defined CONFIG_MCRUSOE
#define MODULE_PROC_FAMILY "CRUSOE "
#elif defined CONFIG_MWINCHIPC6
#define MODULE_PROC_FAMILY "WINCHIPC6 "
#elif defined CONFIG_MWINCHIP2
#define MODULE_PROC_FAMILY "WINCHIP2 "
#elif defined CONFIG_MWINCHIP3D
#define MODULE_PROC_FAMILY "WINCHIP3D "
#elif defined CONFIG_MCYRIXIII
#define MODULE_PROC_FAMILY "CYRIXIII "
#elif CONFIG_MVIAC3_2
#define MODULE_PROC_FAMILY "VIAC3-2 "
#else
#error unknown processor family
#endif
 
Old 02-15-2004, 09:34 AM   #8
deloptes
Member
 
Registered: Feb 2004
Location: AT
Distribution: debian etch and SUSE 10.2
Posts: 123

Rep: Reputation: 15
are you willing to replace linus torvald or what?

the asm directory contains system-type specific definitions and a link is made to the directory containing your system definitions i.e. i386 for ibm-pc (386 style)

# root@bendida:/mnt/devel/src/linux# ls -al include/asm
# lrwxrwxrwx 1 root root 8 Feb 15 14:01 include/asm -> asm-i386

Uhh read the kernel docs finally - everything is written there!

first you are not reading the right manuals and now I doubt, you know what you are doing.
What do you need this all stuff for

Include the header files and they will find their way, otherwise I don't think your program will be usable - of course you should check (include) the architecture type but starting let say with standard 386 proccessor type would fit all.

It is in fact enough to
include asm/modules.h
from "YOUR_KERNELSRC_DIR"/include (YOUR_KERNELSRC_DIR is usally /usr/src/linux)

or something like this so your preprocessor knows the system type you are building for.

NB: asm is linked when you save and exit the configure script as you define the system type there. If you dont run make menuconfig or make xconfig than you should link asm yourself

r3gard5
 
Old 02-15-2004, 06:42 PM   #9
kmack2001
LQ Newbie
 
Registered: Feb 2004
Posts: 7

Original Poster
Rep: Reputation: 0
I am just a newbie trying to build a "hello world" kernel module before moving on.

From make menuconfig
the cpu type is "(586-w/o-cmpxchg8) Processor family"

It seems that this processor family (CONFIG_M586NOCX8=y) is not supported or is not accounted for. It is not in the if defs in module.h

what processor family do you have??
 
Old 02-16-2004, 01:02 PM   #10
deloptes
Member
 
Registered: Feb 2004
Location: AT
Distribution: debian etch and SUSE 10.2
Posts: 123

Rep: Reputation: 15
What do you need this dummy kernel module before moveing on - where to are you moving - I don't understand, but anyway in my .config it stays CONFIG_MPENTIUMIII=y and that's what I have, but I build a kernel for another machine and it says CONFIG_M586=y and truly it's Pnetium I (585). When are you going to read the kernel doc's finally it's always there. You can find out what processor you have by typing
# less /proc/cpuinfo

optionally less /proc/cpuinfo | grep model

processor : 0
vendor_id : GenuineIntel
cpu family : 6
model : 7
model name : Pentium III (Katmai)
stepping : 3
cpu MHz : 501.891
cache size : 512 KB
fdiv_bug : no
hlt_bug : no
f00f_bug : no
coma_bug : no
fpu : yes
fpu_exception : yes
cpuid level : 2
wp : yes
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov
pat pse36 mmx fxsr sse
bogomips : 1002.70

r3gard5
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
lopster v1.2.2 make error: No rule to make target `m4/glibc21.m4' Kropotkin Fedora 0 10-31-2004 11:19 AM
make: *** No rule to make target 'gconfig'. Stop. cswake Slackware 4 10-10-2004 12:13 PM
Error "make: *** No rule to make target `install'. Stop." help Ohmn Mandriva 8 07-02-2004 07:02 PM
Error: *** No rule to make target 'all'. Stop aa2bi Linux - Newbie 6 06-08-2004 12:55 PM
No rule to make target `/mkspecs/default/qmake.conf', needed by `Makefile'. Stop Julianus Linux - General 0 12-21-2003 07:17 AM


All times are GMT -5. The time now is 06:07 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration