automake
[Top][All Lists]
Advanced

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

Re: portable $(notdir) function


From: Ralf Wildenhues
Subject: Re: portable $(notdir) function
Date: Tue, 15 Sep 2009 06:27:18 +0200
User-agent: Mutt/1.5.20 (2009-08-09)

Hello Lorenzo,

* Lorenzo Bettini wrote on Mon, Sep 14, 2009 at 09:19:16AM CEST:
> In a Makefile.am I'd like to use $(notdir $<) but that's a GNU make
> extension... is there a way of achieving the same result in a
> portable way?  Does automake provide a special variable/function for
> that?

As long as you don't need to support backslashes and drive specs, you
can use
  echo $< | sed 's,.*/,,'

For these occasions, basename is probably just as portable.

But please note that using $< is portable only inside inference rules.

Cheers,
Ralf




reply via email to

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