Christian Lohmaier wrote: > Hi ', > > I have a question about conditinal macros an %-rules. I'm not sure > whether I understand the manpage and the functionality correctly, > so here's a small testcase: > > foobar ?= VALUE:="plain-rule" > foobar_% ?= VALUE:="percent-rule" > > foobar: > echo "value $(VALUE)" > > foobar_%: > echo "value $(VALUE)"
I like testcases :)
> running dmake foobar prints "value plain-rule" - but when running dmake
> foobar_abc it prints "value " - so the Macro VALUE is not evaluated at
> all.
You most probably discovered a bug, but fortunately one that can be
easily worked around :)
Try this makefile instead:
- - mymakefile.mk - -
SHELL*:=/bin/sh
SHELLFLAGS*:=-ce
foobar ?= VALUE:="plain-rule"
foobar:
echo "value $(VALUE)"
foobar_%:
echo "value $(VALUE)"
foobar_% ?= VALUE:="percent-rule"
- - - -
$ ./dmake/dmake.exe -rf mymakefile.mk foobar_xww
echo "value "percent-rule""
"value "percent-rule""
Moving the conditional macro definition behind the %-target
definition fixes this. Can you please file an issue for me for this?
> The manpage reads:
> If a %-meta rule target has associated conditional macro assignments,
> and the rule is chosen by the inference algorithm then the conditional
> macro assignments are inferred together with the associated recipe.
>
> That makes me believve it should be possible to use them, OTOH I didn't
> fully understand that sentence.
>
> Maybe somebody could explain how it is supposed to work in some easy
> terms...
It should work, it's a bug.
Volker
>
> ciao
> Christian
--
= http://wiki.services.openoffice.org/wiki/Debug_Build_Problems =
PGP/GPG key (ID: 0x9F8A785D) available from wwwkeys.de.pgp.net
key-fingerprint 550D F17E B082 A3E9 F913 9E53 3D35 C9BA 9F8A 785D
signature.asc
Description: OpenPGP digital signature
