[SOLVED] Makefile shell with multiple commands

Programming languages, Coding, executables, and scripting.
Post Reply
Message
Author
shogun1234
Posts: 139
Joined: 2006-07-13 08:04

[SOLVED] Makefile shell with multiple commands

#1 Post by shogun1234 »

I have a Makefile (make version 4.3 debian bullseye/sid and kernel 5.6.0-1-rt-amd64) contains

Code: Select all

       $(eval svn := $(shell $(basename which svn)))
        echo $(svn)
which prints following message on console.

Code: Select all

echo /usr/bin/svn
Change to use

Code: Select all

        $(eval svn := $(shell $(basename $(which svn))))
        echo $(svn)
it prints following message on console.

Code: Select all

echo 
However I want to achieve the effect the same as executing command basename `which svn`, which would return svn. How can I achieve this effect?

Thanks
Last edited by shogun1234 on 2021-03-17 08:40, edited 1 time in total.

shogun1234
Posts: 139
Joined: 2006-07-13 08:04

Re: Makefile shell with multiple commands

#2 Post by shogun1234 »

Ok I think I fix the problem. Change to

Code: Select all

        $(eval svn_bin := $(shell basename $(shell which svn)))
fixes the problem. Thanks

Post Reply