help-make
[Top][All Lists]
Advanced

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

Re: A better way to perform substitution in make


From: Randy Kao
Subject: Re: A better way to perform substitution in make
Date: Thu, 30 Apr 2009 13:16:52 -0700

First off I wanted to give a belayed thanks to Allan and Harvey for their feedback.

My first attempt at attacking this problem was incorrect because this Makefile runs on *nix and Windows, whereas my solution seems to work only on Unix / Linux.

Using the find command in $(shell find -type f) is not portable in this case.

Looking through the make functions, I didn't seem to find anything that would go and list out files given an argument of a top level directory.

I know of the foreach iterator and in conjunction with the wildcard function could list everything out, however you would still need  to get a list of all the subdirectories to pass to it.

There is an easier way to do this right?

Thanks,
Randy



On Mon, Apr 20, 2009 at 8:28 PM, Allan Wind <address@hidden> wrote:
On 2009-04-20T19:50:34, Randy Kao wrote:
> I was trying to implement a variable assignment to all files below the
> current directory where my Makefile resides currently.

Here is what I do:

rootdir = $(word 1,$(patsubst %/,%,$(dir $(MAKEFILE_LIST))))


/Allan
--
Allan Wind
Life Integrity, LLC
http://lifeintegrity.com



_______________________________________________
Help-make mailing list
address@hidden
http://lists.gnu.org/mailman/listinfo/help-make


reply via email to

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