On Fri, Apr 17, 2009 at 1:31 AM, Christophe LYON <[email protected]> wrote:
> Hello,
>
> I have a project where the Makefile has simple rules such as:
>
> %.suf1: %.suf2
>        $(CMDPATH)/cmd
>
> where the target is actually /path/to/dir1.
>
> Now, I need to add a dependency to a file which is not in /path/to/dir1, so
> %.suf1: %.suf2 %.suf3
> won't match.
>
> I think using vpath won't help either.
>
> I usually avoid using paths in target names, but unfortunately I am not the
> one who originally wrote the whole build system :-(
>
> What is the suggested way of handling such cases?
>
> Thanks,
> Christophe.

Send an angry letter to the build system designer.

And maybe think of implementing the implicit rules so that they're
dependent on expanded variables. Example:

DEPENDS_DIR ?= $(CURDIR)
TARGET_DIR ?= $(DEPENDS_DIR)

$(TARGET_DIR)/%.suf1: $(DEPENDS_DIR)/%.suf2 $(DEPENDS_DIR)/%.suf3

That or implement it using a smarter static rule :).

-Garrett


_______________________________________________
Help-make mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/help-make

Reply via email to