Thread overview | ||||||
---|---|---|---|---|---|---|
|
September 07, 2001 Smake comparisions | ||||
---|---|---|---|---|
| ||||
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 Re: Smake comparisions | ||||
---|---|---|---|---|
| ||||
Posted in reply to Rajiv Bhagwat | 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 Re: Smake comparisions | ||||
---|---|---|---|---|
| ||||
Posted in reply to Walter | 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 Re: Smake comparisions | ||||
---|---|---|---|---|
| ||||
Posted in reply to Rajiv Bhagwat | 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. >> >> > > |
Copyright © 1999-2021 by the D Language Foundation