remove prefix with make? - Unix

This is a discussion on remove prefix with make? - Unix ; I have made a variable FIGFILES that contains names of all fig files in the dir $(dir): FIGFILES=$(wildcard $(dir)*.fig) When I print FIGFILES I get: echo pic/diagram2.fig pic/diagram.fig Now I would like to create another variable that contains the filenames ...

+ Reply to Thread
Results 1 to 2 of 2

Thread: remove prefix with make?

  1. remove prefix with make?

    I have made a variable FIGFILES that contains names of all fig files in
    the dir $(dir):

    FIGFILES=$(wildcard $(dir)*.fig)

    When I print FIGFILES I get:

    echo pic/diagram2.fig pic/diagram.fig

    Now I would like to create another variable that contains the filenames
    without the $(dir). I have tried:

    FIGFILES2=$(FIGFILES:$(dir)=)

    But when I print this new variable I still get:

    echo pic/diagram2.fig pic/diagram.fig

    Is there someway to remove the prefix defined by $(dir) in this case?

  2. Re: remove prefix with make?

    On Mar 11, 3:05*pm, saneman wrote:
    > I have made a variable FIGFILES that contains names of all fig files in
    > the dir $(dir):
    >
    > FIGFILES=$(wildcard $(dir)*.fig)
    >
    > When I print FIGFILES I get:
    >
    > echo pic/diagram2.fig pic/diagram.fig
    >
    > Now I would like to create another variable that contains the filenames
    > without the $(dir). I have tried:
    >
    > FIGFILES2=$(FIGFILES:$(dir)=)
    >
    > But when I print this new variable I still get:
    >
    > echo pic/diagram2.fig pic/diagram.fig
    >
    > Is there someway to remove the prefix defined by $(dir) in this case?


    GNU make has $(notdir ...), e.g. in your case $(notdir $(FIGFILES)):
    http://www.gnu.org/software/make/man...Name-Functions

+ Reply to Thread