Thread overview
Smake comparisions
Sep 07, 2001
Rajiv Bhagwat
Sep 08, 2001
Walter
Sep 08, 2001
Rajiv Bhagwat
Sep 08, 2001
Walter
September 07, 2001
The following makefile is indicating that the smake is goofing up. Or am I?
-------------
all:
    echo "$*"
!if "$*" == "all"
    echo Target is "$*"
!else
    echo But target is "$*"
!endif
-------------
It prints "But...". So does 'maker' and even 'nmake' after complaining about $*. Saying 'smake all' produces exactly the same result. What goes?



September 08, 2001
Rajiv Bhagwat wrote in message <9nb7nk$1oii$1@digitaldaemon.com>...
>The following makefile is indicating that the smake is goofing up. Or am I?
>-------------
>all:
>    echo "$*"
>!if "$*" == "all"
>    echo Target is "$*"
>!else
>    echo But target is "$*"
>!endif
>-------------
>It prints "But...". So does 'maker' and even 'nmake' after complaining
about
>$*. Saying 'smake all' produces exactly the same result. What goes?


The $* is only valid for lines that start with whitespace. A line not starting with whitespace breaks the expansion, as your !if does.


September 08, 2001
Well, that explains it. Any logic behind it?
We need to practice more 'modeless' programming to avoid such confusions.
-- Rajiv

Walter <walter@digitalmars.com> wrote in message news:9nc5sg$2933$1@digitaldaemon.com...
>
> Rajiv Bhagwat wrote in message <9nb7nk$1oii$1@digitaldaemon.com>...
> >The following makefile is indicating that the smake is goofing up. Or am
I?
> >-------------
> >all:
> >    echo "$*"
> >!if "$*" == "all"
> >    echo Target is "$*"
> >!else
> >    echo But target is "$*"
> >!endif
> >-------------
> >It prints "But...". So does 'maker' and even 'nmake' after complaining
> about
> >$*. Saying 'smake all' produces exactly the same result. What goes?
>
>
> The $* is only valid for lines that start with whitespace. A line not starting with whitespace breaks the expansion, as your !if does.
>
>


September 08, 2001
Makefiles are collections of random ad-hoc rules that conflict with each other.

Rajiv Bhagwat wrote in message <9ncqpp$2n35$1@digitaldaemon.com>...
>Well, that explains it. Any logic behind it?
>We need to practice more 'modeless' programming to avoid such confusions.
>-- Rajiv
>
>Walter <walter@digitalmars.com> wrote in message news:9nc5sg$2933$1@digitaldaemon.com...
>>
>> Rajiv Bhagwat wrote in message <9nb7nk$1oii$1@digitaldaemon.com>...
>> >The following makefile is indicating that the smake is goofing up. Or am
>I?
>> >-------------
>> >all:
>> >    echo "$*"
>> >!if "$*" == "all"
>> >    echo Target is "$*"
>> >!else
>> >    echo But target is "$*"
>> >!endif
>> >-------------
>> >It prints "But...". So does 'maker' and even 'nmake' after complaining
>> about
>> >$*. Saying 'smake all' produces exactly the same result. What goes?
>>
>>
>> The $* is only valid for lines that start with whitespace. A line not starting with whitespace breaks the expansion, as your !if does.
>>
>>
>
>