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