[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: How to switch behaviour according to glibc version?
From: |
Paul Smith |
Subject: |
Re: How to switch behaviour according to glibc version? |
Date: |
Wed, 06 Apr 2016 07:47:51 -0400 |
On Wed, 2016-04-06 at 09:46 +0000, David Aldrich wrote:
> But if I do:
>
> verstr := $(shell ldd --version | head -1 | awk '{print $NF}')
> $(info glibc $(verstr) detected)
>
> I see:
>
> glibc detected
>
> So there is something wrong with the awk command. It works ok from the
> command line but not in the makefile. Might the apostrophes be the
> problem?
You have to always escape all "$" you want to pass through to a shell,
either in a recipe or a variable or a $(shell ...) function call. All
instances of single "$" are expanded by make as variables or functions,
before it invokes the shell.
So, write:
verstr := $(shell ldd --version | head -1 | awk '{print $$NF}')
^^
- How to switch behaviour according to glibc version?, David Aldrich, 2016/04/05
- Re: How to switch behaviour according to glibc version?, David Boyce, 2016/04/05
- RE: How to switch behaviour according to glibc version?, David Aldrich, 2016/04/05
- Re: How to switch behaviour according to glibc version?, David Boyce, 2016/04/05
- RE: How to switch behaviour according to glibc version?, David Aldrich, 2016/04/06
- Re: How to switch behaviour according to glibc version?,
Paul Smith <=
- RE: How to switch behaviour according to glibc version?, David Aldrich, 2016/04/06
- RE: How to switch behaviour according to glibc version?, Cook, Malcolm, 2016/04/14
Re: How to switch behaviour according to glibc version?, Yann Droneaud, 2016/04/06
RE: How to switch behaviour according to glibc version?, rakesh sharma, 2016/04/14