bug-make
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Target-specific variable in subdirectory problem


From: Edward Welbourne
Subject: Re: Target-specific variable in subdirectory problem
Date: Wed, 2 Aug 2017 13:54:28 +0000

Benjamin Cama (2 August 2017 12:19)
> I may be doing something wrong, but the following Makefile gives me
> strange results: the target-specific variable does not apply when used
> for a target in a subdirectory.
>
>        test-%: FOO = BAR
>        test-%:
>                echo $(FOO)
>
> E.g.:
>
>        $ make test-stem
>        echo BAR
>        BAR
>        $ make subdir/test-stem
>        echo
>
> What am I doing wrong?

the target test-% doesn't match subdir/test-%
It only matches a name starting "test-" (with arbitrary suffix as %).
Contrast with %-stem, which matches test-stem as well as
subdir/test-stem, since % can stand for arbitrary things.

> PS: please Cc me, I'm not subscribed. Thanks.

        Eddy.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]