Pantek Library
Hosting Provided By
CybrHost
High Speed Hosting

Re: "shell" in Makefile

From: Karl E. Jorgensen <karl(at)jorgensen.org.uk>
Date: Sun Jun 24 2007 - 14:13:48 EDT


On Sun, Jun 24, 2007 at 09:40:40AM -0700, Easthope wrote:
> Debian users,
>
> In
>
> http://git.kernel.org/?p=linux/kernel/git/linville/wireless-dev.git;a=
> summary
>
> Vivek described a makefile containing this text.
>
> obj-m := hello.o
> KDIR := /lib/modules/$(shell uname -r)/build
> PWD := $(shell pwd)
> default:
> $(MAKE) -C $(KDIR) SUBDIRS=$(PWD) modules
>
> shell is not a command in the Etch here.

It is not a command in etch. But it is in GNU Make:

    http://www.gnu.org/software/make/manual/html_node/Shell-Function.html#Shell-Function

> So what is "shell uname -r" and "shell pwd"?

That's the way to get the output a command into a Make variable.

> Why not just $(uname -r) and $(pwd)?

It would be in bash - where $( somecommand ) is replaced by the output of somecommand.

Make uses the syntax of $(variablename) to reference the value of a variable - and $(functionname params) to call functions - one of which is 'shell', which calls an external (to make) command.

Do you need help?X

Hope this helps

-- 
Karl E. Jorgensen
karl(at)jorgensen.org.uk  
http://www.jorgensen.org.uk/karl(at)jorgensen.com     
http://karl.jorgensen.com
==== Today's fortune:
Lady Nancy Astor:
	"Winston, if you were my husband, I'd put poison in your coffee."
Winston Churchill:
	"Nancy, if you were my wife, I'd drink it."

-- To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org

Received on Sun Jun 24 14:14:32 2007

This archive was generated by hypermail 2.1.8 : Sun Jun 24 2007 - 14:20:02 EDT


Contact Us  Legal Notices  Order Services Online 
Pantek Home  Privacy Policy  IT news  Site Map  Pantek Library