Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

[BUG]? Scary behaviour of MAKE 5.2 - substitution

0 views
Skip to first unread message

dazbee

unread,
Jun 30, 2003, 1:58:10 AM6/30/03
to
Hi folks,

I've been trying to do a build of the Ruby
programming language which contains the
following lines:

!ifndef icondirs
!ifdef ICONDIRS
icondirs=$(ICONDIRS)
!endif
!endif
!ifdef icondirs
icondirs=$(icondirs:\=/)
iconinc=-I$(icondirs: = -I)
!endif

.. which seemed mostly harmless and I
chased several wild geese thinking that
the problem was in my 'icondirs=D:\aux...'
containing a colon or something was being
'double-escaped' etc. (Being a novice.)

The problem appears to be with the assignment
of a substituted variable.


###----------### Example 1

V01 = XaaBaaX
V02 = $(V01:B=a)
!message K1 V01 = $(V01), V02 = $(V02)
V01 = $(V01:B=A)
!message K2 V01 = $(V01), V02 = $(V02)


# MAKE Version 5.2 Copyright (c) 1987, 2000 Borland
# K1 V01 = XaaBaaX, V02 = XaaaaaX
#
# K2 V01 = XaaBaaX:B=A), V02 = XaaaaaX:a=A)


###----------### Example 2


V01 = XaaBaaX
V02 = $(V01:B=a)
!message K1 V01 = $(V01), V02 = $(V02)
V01 = $(V02)
!message K2 V01 = $(V01), V02 = $(V02)


# MAKE Version 5.2 Copyright (c) 1987, 2000 Borland
# K1 V01 = XaaBaaX, V02 = XaaaaaX
#
# K2 V01 = , V02 =

###----------###

Is this problem known about or documented ?

Apologies if this is an "old chestnut" but I did
a fairly extensive web-search before arriving here.


Thanks for any insight,


dazbee

Bob Gonder

unread,
Jun 30, 2003, 3:26:58 AM6/30/03
to
"dazbee" <daz...@d10.karoo.co.uk> wrote:
>
>The problem appears to be with the assignment
>of a substituted variable.
>
>###----------### Example 1
>
>V01 = XaaBaaX
>V02 = $(V01:B=a)
>!message K1 V01 = $(V01), V02 = $(V02)
>V01 = $(V01:B=A)
>!message K2 V01 = $(V01), V02 = $(V02)
>
># MAKE Version 5.2 Copyright (c) 1987, 2000 Borland
># K1 V01 = XaaBaaX, V02 = XaaaaaX
>#
># K2 V01 = XaaBaaX:B=A), V02 = XaaaaaX:a=A)

It looks like they are (which of course, they are) macros, not
assignments. As such, they build up:

!message K2 V01 = $(V01), V02 = $(V02)

expand V02
!message K2 V01 = $(V01), V02 = $($(V01:B=a))
expand the current V01
!message K2 V01 = $($(V01:B=A)), V02 = $($($(V01:B=A):B=a))
subtitue the original V01
!message K2 V01 = $($(XaaBaaX:B=A)), V02 = $($((XaaBaaX:B=A):B=a)
apply the V02 substitution
!message K2 V01 = $($(XaaBaaX:B=A)), V02 = $($(XaaaaaX:a=A))

>###----------### Example 2
>
>V01 = XaaBaaX
>V02 = $(V01:B=a)
>!message K1 V01 = $(V01), V02 = $(V02)
>V01 = $(V02)
>!message K2 V01 = $(V01), V02 = $(V02)
>
>
># MAKE Version 5.2 Copyright (c) 1987, 2000 Borland
># K1 V01 = XaaBaaX, V02 = XaaaaaX
>#
># K2 V01 = , V02 =

!message K2 V01 = $(V01), V02 = $(V02)
expand V02
!message K2 V01 = $(V01), V02 = $($(V01:B=a))
expand the current V01
!message K2 V01 = $($(V02)), V02 = $($($(V02):B=a))
subtitue the original V01
!message K2 V01 = $($(V02)), V02 = $($($(V02):B=a))
apply the V02 substitution
!message K2 V01 = $($(V02)), V02 = $($($(V02)))
or

dazbee

unread,
Jun 30, 2003, 3:53:16 PM6/30/03
to

"Bob Gonder" <no...@notmindspring.invalid> wrote:

>
> [...] macros, not assignments.
>

A distinction which you have successfully impressed
upon me.

More power, in stark constrast to my implication.

Thanks for the line-by-line, Bob.
dazbee

0 new messages