help-make
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Conditionals, step one


From: Paul Smith
Subject: Re: Conditionals, step one
Date: Thu, 16 Sep 2010 16:20:24 -0400

On Thu, 2010-09-16 at 12:36 -0700, Radly wrote:
> Thanks, that was helpful, except that 'info' seems to be a no-op.

That means you're using an older version of GNU make where it wasn't
implemented.

You can use $(warning ...) instead; that was implemented earlier.

> ifeq (${value OSTYPE},linux-gnu)
>   TXT = GOT_IT
> else
>   TXT = MISSED_IT
> endif
> 
> all:
>         @echo ${TXT}

You should not use the $(value ...) function, as I mentioned in my last
email.

> Now I would like to know how to pick up OSTYPE directly from the
> shell, without having to type "make OSTYPE = $OSTYPE".  If I enter it
> that way, the makefile prints out "GOT_IT", but if I just type "make",
> it prints "MISSED_IT".

If you are correctly exporting your OSTYPE variable from the shell, then
using the make variable $(OSTYPE) as we described will work.

If, in your shell, you run "env | grep OSTYPE" does it show the value
for OSTYPE?  If so then it's exported properly.

If not then you need to run "export OSTYPE" to export it.  This is in no
way related to make; this is a feature of the shell.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]