help-make
[Top][All Lists]
Advanced

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

Removing . and .. from paths


From: Vegard Nossum
Subject: Removing . and .. from paths
Date: Sun, 11 Nov 2007 15:53:31 +0100

Hello.

I am looking for a function that removes . and .. components from a
list of paths, without requiring the path to exist, and without making
the path absolute. I find the following function to do what I want:

normpath = $(patsubst $(abspath .)/%,%,$(abspath $(1)))

Then,  $(call normpath,src/lib/../a.c src/lib/../b.c)) will return
"src/a.c src/b.c", which is what I want. (In the case that .. moves
out of the top-level directory where make was run from, it returns an
absolute path). However, this can be implemented a lot more efficient
if it was a part of core make. Why does this not exist already? Or did
I just miss it? If I write the function, will it be included in core
make?

Thanks.

Kind regards,
Vegard Nossum




reply via email to

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