0

I want to remove the root directory of a targeted path in a Makefile.

Let say the target is like

OUTPUT = output
PATH = $(OUTPUT)/a.txt

Later when building the target, this works

echo $(@:output/%=%)
>>> a.txt

But not if I use the var $OUTPUT instead of the string:

echo $(@:$(OUTPUT)/%=%)
>>> output/a.txt
user3240484
  • 209
  • 1
  • 4
  • 1
    Both work for me. – Maxim Egorushkin May 14 '18 at 13:51
  • 2
    The makefile section you call "the target is like" is not a target. Those are variable assignments. You don't actually show the target; please show the entire makefile rule in question, not just a part of the recipe. An SSCCE http://sscce.org/ would be best. – MadScientist May 14 '18 at 14:34

0 Answers0