[Top][All Lists]

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

A better way to perform substitution in make

From: Randy Kao
Subject: A better way to perform substitution in make
Date: Mon, 20 Apr 2009 19:50:34 -0700

Hi all,

I was trying to implement a variable assignment to all files below the current directory where my Makefile resides currently.

I ended up with the following:

ALLFILES := $(shell find . -type f)

The only problem with this was that it gave me a leading "./" (i.e. ./abc.txt, ./dir1/, ./dir2/foo.txt, etc) in front of the files.

I then tried to use make's patsubst and filter-out to remove the "./" with no luck.

EDITEDFILES := $(patsubst ./,,$(ALLFILES))

Is there something obviously wrong that I'm missing or is there even a better way to do this entirely?

Your feedback is greatly appreciated as usual.

Thanks for your time,

reply via email to

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