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
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
>
> [...] 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