help-make
[Top][All Lists]
Advanced

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

Re: Remove trailing (back)slash?


From: Edgar
Subject: Re: Remove trailing (back)slash?
Date: Wed, 23 Nov 2011 16:04:28 -0600
User-agent: Thunderbird 2.0.0.24 (Windows/20100228)

Paul Smith wrote:
On Wed, 2011-11-23 at 15:45 -0600, Edgar wrote:
Paul Smith wrote:
On Wed, 2011-11-23 at 14:41 -0600, Edgar wrote:
Anyone have any idea how to remove a trailing (back) slash from a directory?
$(patsubst %\,%,$(VARIABLE))

will do it.

Awesome Paul, thanks. I didn't realize you could use % in patsubst.

Sure, that's what the "pat" in "patsubst" stands for: "pattern".

Are you sure that would match everything up to the slash though, including base directories and other slashes that might be there? I thought % only matched the non-directory part of a file.

Yes I'm sure.  You can check the documentation:

        Here PATTERN may contain a `%' which acts as a wildcard,
        matching any number of any characters within a word.

Thanks again for the clarification. My makefile is starting to shape up right thanks to you.




reply via email to

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