Makefile for Open suse

hello people !:slight_smile:
i want to make a Makefile for compiling my C code to develop module , but i have error when it reads the path /lib/modules/$(uname -r)/build , any help? :slight_smile:
when i do ls ,build shows with red color

On 02/27/2013 11:16 PM, wiss1990 wrote:
>
> hello people !:slight_smile:
> i want to make a Makefile for compiling my C code to develop module ,
> but i have error when it reads the path /lib/modules/$(uname -r)/build ,
> any help? :slight_smile:
> when i do ls ,build shows with red color

i don’t believe you actually have a path like


/lib/modules/$(uname -r)/build

because “$(uname -r)” is not a ‘normal’ directory name, instead it is
a normal command line command and i have no idea why it appears in
your path…

do you know why it is there? it sure looks like a typo to me, and i
would expect it to result in a error as you say it did…take that
part out and try again.

perhaps you were supposed to substitute in the name of a directory
after running ‘uname -r’, like here i would sub in
“3.0.58-28-desktop” (which is my running kernel)!


dd
openSUSE®, the “German Engineered Automobile” of operating systems!
http://tinyurl.com/DD-Caveat

Try this, and you’ll see that there’s nothing wrong with the command

laptop:~> echo $(uname -r)

The info you provide is by far not enough to help you. Please state your openSUSE version, what’s installed to build a kernel module (I guess that’s what you’re trying).

On Thu, 28 Feb 2013 19:05:29 +0000, dd wrote:

> because “$(uname -r)” is not a ‘normal’ directory name, instead it is a
> normal command line command and i have no idea why it appears in your
> path…

In bash that’s perfectly acceptable - it’s command substitution.


jhenderson@lamuella:~> cd /lib/modules/$(uname -r)/
jhenderson@lamuella:/lib/modules/3.4.28-2.20-desktop>

Jim

Jim Henderson
openSUSE Forums Administrator
Forum Use Terms & Conditions at http://tinyurl.com/openSUSE-T-C

On 02/28/2013 10:52 PM, Jim Henderson wrote:
> In bash that’s perfectly acceptable - it’s command substitution.

MAGIC! i had no idea…seems i need to do a lot of bash study!


dd
openSUSE®, the “German Engineered Automobile” of operating systems!

thnx for replies
i use the kernel 2.6.31-rc8-rt9-3-rt for open suse 12.2 , (i installed the kernel-rt) and my path is /lib/modules/$(uname -r) , but in makefile it can’t read the build file (this file seems colored with red and with ls -l it shows that ,build -> /usr/src/$(uname -r)-obj/i386/rt
plz i need help