Unix Shell - conditional in makefile only operates on text?

This is Interesting: Free IT Magazines  
Home > Archive > Unix Shell > March 2004 > conditional in makefile only operates on text?





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author conditional in makefile only operates on text?
Kelly

2004-03-29, 10:39 am

Hi,

I have been reading info makefile. So far conditional if
can only operate on text.

It means I cannot do this? compare number greater than or less than

(this is wrong)...
if $$one > $$two; then exit -2; fi

Thanks.

Barry Margolin

2004-03-29, 12:38 pm

In article <7SW9c.795$j57.269722@news20.bellglobal.com>,
Kelly <kelly@invalid.com> wrote:

> Hi,
>
> I have been reading info makefile. So far conditional if
> can only operate on text.
>
> It means I cannot do this? compare number greater than or less than
>
> (this is wrong)...
> if $$one > $$two; then exit -2; fi
>
> Thanks.


The commands in makefiles are executed by the shell, so you can use any
test that you could use in a shell script. E.g.

if [ $$one -gt $$two]; then exit 2; fi

--
Barry Margolin, barmar@alum.mit.edu
Arlington, MA
*** PLEASE post questions in newsgroups, not directly to me ***
Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com