🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.misc.discuss
Article #74348

Re: Extensions to GNU-make.

#74348
From: Graham Dumpleton
Date: Tue, 07 May 1991 23:42
71 lines
2948 bytes
Had a bit more of a think about this and came up with the following changes.

In article <2665@otc.otca.oz>, grahamd@otc.otca.oz.au (Graham Dumpleton) writes:
|> PROPOSAL 2:
|> 
|> This second proposal would involve more work than the first. (I don't know
|> enough at the moment about the structure of the GNU-make code and so doubt that
|> I would be do this without some help)
|> 
|> It is proposed here to implement a feature comparable to the Sun make feature
|> described in 'PRECEDENCE' above. Namely to allow macros to be defined or
|> redefined for a particular target.
|> 
|> Since GNU-make already uses the ':=' notation which Sun make uses, an
|> alternative syntax would be required. The remaining sytnax would be the same.
|> For example:
|> 
|>   test :+ THREE = $@
|> 
|> Note that ':+' is used here, however an alternative could be used, eg. ':-'.
|> Also note that it may not make sense to allow:
|> 
|>   test :+ THREE := $@

|> As far as I can tell it could not be made to make things happen any
|> differently.
|> 
|> It is preferable that this proposal be implemented in conjunction with the
|> previous proposal.

Firstly the ':=' would be different. I forgot that 'THREE' would also be
available for expansion within the rule and therefore it could behave differently.
This lead me on to think that a better way of doing this would be not to
combine it with the previous proposal, instead have things such that

  test :+ THREE = $@

would result in 

  THREE = $@

being placed in the environment, and

  test :+ THREE := $@

resulting in

  THREE = test

Essentially the meaning placed on things by ':=' is that it would be expanded
at the point that the rule is executed. (Just after $@ etc had been set.)
This seems to be in line with the meaning of '=' and ':=' now in that the first is expanded when used and the second is expanded at the point where it is defined.
The slight difference is that we are saying that it can only be validly expanded
when the rule is being executed.

|> This would mean that by default the above would result in
|> an environment variable of
|> 
|>   THREE = $@
|> 
|> being created. However if
|> 
|>   .EXPAND : THREE
|> 
|> were defined then the result would be
|> 
|>   THREE = test
|> 

--
Graham Dumpleton (grahamd@otc.otca.oz.au)
Technical Details
Message-ID: <2668@otc.otca.oz>
Path: arc1-ca.pugleaf.net!gmdzi!unido!mcsun!uunet!munnari.oz.au!metro!otc!grahamd
References: <2665@otc.otca.oz>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 1025b4,ef20a37c04b2509a
X-Google-Attributes: gid1025b4,public
X-Google-ArrivalTime: 1991-05-08 13:23:27 PST
Path: arc1-ca.pugleaf.net!gmdzi!unido!mcsun!uunet!munnari.oz.au!metro!otc!grahamd
From: grahamd@otc.otca.oz.au (Graham Dumpleton)
Newsgroups: gnu.misc.discuss
Subject: Re: Extensions to GNU-make.
Message-ID: <2668@otc.otca.oz>
Date: 7 May 91 23:42:17 GMT
References: <2665@otc.otca.oz>
Sender: news@otc.otca.oz
Reply-To: grahamd@otc.otca.oz.au (Graham Dumpleton)
Organization: OTC Development Unit, Australia
Lines: 71