On Tue, May 27, 2014 at 2:01 PM, patrick <[email protected]> wrote:

> Hello,
> I am begginer with gnu make and I am trying to implement the next:
> -I have a source file which contains include directive

-I have a make file with the next content:
>
> file_nam=demo_c0.txt
> file_content=$(shell cat ${file_nam})
> rez=$(word 1,$(file_content))
> f:
>         echo $(rez)
>
> When I am executing this nothing is displayed,
>

I doubt it.  I would bet you're either seeing this:
   echo #include
or maybe this:
   make: 'f' is up to date.

...or you didn't quote your Makefile accurately.  If your makefile actually
had this rule:

f:
        @echo $(rez)

*then* you would see nothing...and removing the '@' makes the problem more
clear: the $(rez) is expanded before the command is passed to the shell, so
any shell meta-characters in it will still be magic to the shell.  The
shell treats words starting with a '#' as the start of a comment, so from
there to the end of the line will be ignored.  To pass it through you'll
need to quote it either with single or double-quotes, ala:

f:
        @echo '$(rez)'


Philip Guenther
_______________________________________________
Help-make mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/help-make

Reply via email to