Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 6 Jun 2012 19:19:01 -1000
From:      Parv <parv@pair.com>
To:        Tim Daneliuk <tundra@tundraware.com>
Cc:        FreeBSD Mailing List <freebsd-questions@freebsd.org>
Subject:   Re: Somewhat OT - A Makefile Question
Message-ID:  <20120607051901.GA2205@holstein.holy.cow>
In-Reply-To: <4FCF48AF.307@tundraware.com>
References:  <4FCF48AF.307@tundraware.com>

next in thread | previous in thread | raw e-mail | index | archive | help
in message <4FCF48AF.307@tundraware.com>,
wrote Tim Daneliuk thusly...
>
...
> Within a makefile, I need to assign the name of a program as in:
>
> FOO = "bar".
>
> The problem is that 'bar' may also be know as, say, "bar.sh".
...
> Is there a simple way to determine which form "bar" or "bar.sh" on
> on a given system *at the time the make is run*?  If both exist, I
> will pick one arbitrarily,
...
>  For example I don't think this works when both are there:
>
> FOO = $(shell `which bar bar.sh)

Modify the subshell command to ...

  which bar bar.sh | head -n 1


... as in (for FreeBSD make) ...

  shell=`which zsh sh tcsh csh 2>/dev/null | fgrep -v 'not found' | head -n 3`

  all:
    @printf "%s\n" ${shell}



  - parv

-- 




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20120607051901.GA2205>