开发者

Managing simple variables in GNU Make

Im trying to manage variables on make, but I see there are several types as shell variables with {}, variables set with () and $$ but, now I just try to开发者_C百科 manage simple text variables with that simple code in my Makefile

@WORD=GNUMAKE
    FOUND=1
    PWD=$(PWD)
    $(findstring $$WORD,$$PWD)
    $(shell echo $$FOUND)
    $(shell echo $$PWD)

well, Im really surprised that I only get nothing with that, for me I only could use variables noted with $$ because my $make does not recognize () or {} but the other thing is that compiler gives me an error

FOUND=1
PWD=/home/ogonzalezr/GNUMAKE/changedir
/home/ogonzalezr/GNUMAKE/changedir
make: execvp: /home/ogonzalezr/GNUMAKE/changedir: Permission denied
make: *** [all] Error 127

Now Im wondering, is my make well set on OS? maybe we are talking about some related bug? Im really lost, and really twisted as well because I dont understand anything that could happen.

Thanks for your answers,

Greetings for all


Where to begin? Your use of variables is wrong.

Put this at the top of the makefile:

FOUND = 1

all:
  echo $(FOUND)

Then run make. You should get this working before you try anything more complicated.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜