help-make
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: shell command in a make file


From: Paul Smith
Subject: Re: shell command in a make file
Date: Sat, 31 May 2014 15:16:55 -0400

On Sat, 2014-05-31 at 11:18 -0700, patrick wrote:
> define example
> $(shell \
> particle=typedef \
> source=$(1) \
> )
> endef

The above doesn't make sense.  When this variable is expanded it will
invoke a shell which will set the shell variables "particle" and
"source", then the shell will exit and those values will be lost.

> file_nam=PROJ1/SOURCES/demo_c1.c
> file_content=$(shell cat ${file_nam})
> 
> rez5=$(call example,$(file_content))
> f: 
>       @echo '$(rez5)'
> 
> It does not work, because the code associated with shell is seen as commands
> for f target. What I can do?

I have no idea what you're TRYING to do with this makefile, and you
don't explain, so there's little we can say.

I don't know what you mean by "the code associated with shell is seen as
commands for f target"; when I run the above it prints the empty string
just as I'd expect.

When asking questions please provide: the operating system you're using,
the version of GNU make you're using, the makefile (thank you), the
exact make command line you invoked, the exact output you got
(cut/paste), and a description of why that output is not what you wanted
and what you really did want.

Then we can help.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]