[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Using empty $(else) variable for readability
From: |
Tony Theodore |
Subject: |
Re: Using empty $(else) variable for readability |
Date: |
Mon, 19 Oct 2015 21:49:30 +1100 |
> On 18 Oct 2015, at 01:12, Rakesh Sharma <address@hidden> wrote:
>
> Tony Theodore <tony.t <at> me.com> writes:
>
>>
>> Is this a reasonable idea and is there any chance $(else) will have some
>> defined value in the future?
>>
>
> This is not at all a good idea, since it's very easy in make to slip in
> a variable $(else) whose value whenever it's non-null will cause your
> carefully constructed clauses to come crashing down.
Ah! I wasn’t thinking about all the ways a variable could be set. We have
reasonable control over inputs at the moment but I’m doing this sweep
in preparation for a plugin system where people can load whatever
arbitrary makefiles they want...
> On 18 Oct 2015, at 01:10, Paul Smith <address@hidden> wrote:
>
> "else" as a variable will never have another value. The POSIX standard
> for make reserves variables that start with "." and are all capitalized
> for the implementation.
>
> I suppose it's possible that there could be a function $(else ...)
> created, but I can't imagine what that would be and it wouldn't conflict
> with the variable "else" anyway.
>
> So, you're good.
Thanks, I think I’ll run with it and see what happens.
Cheers,
Tony