[Top][All Lists]

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

Re: Target-specific variable in subdirectory problem

From: Benjamin Cama
Subject: Re: Target-specific variable in subdirectory problem
Date: Thu, 03 Aug 2017 17:00:45 +0200

Le jeudi 03 août 2017 à 14:59 +0200, Benjamin Cama a écrit :
> To further enhance my understanding of the “right” usage of Makefiles,
> would you advise me to explicitly specify the subdirectory in the
> target
> definition? Because I feel that counting on pattern rules to match in
> subdirectory is kind of hackish, now. Like:
>         $(SUBDIR)/target-%:
> And in my particular case, I actually know the $(SUBDIR), but would it
> be right then to call make with:
>         make SUBDIR=foo foo/target-1234
> ? It looks redundant to me.

Well, I tried:

        SUBDIR = $(dir $@)

But it doesn't work. But without a slash (which is already present at
the end of $(SUBDIR)), it actually works!:

        SUBDIR = $(dir $@)

Is this a bug?

Benjamin Cama - Tél : 258

reply via email to

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