help-make
[Top][All Lists]
Advanced

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

Re: Question about use of $(wildcard) and $(foreach)


From: John Graham-Cumming
Subject: Re: Question about use of $(wildcard) and $(foreach)
Date: Mon, 16 Apr 2007 21:38:38 +0200
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.6) Gecko/20040208 Thunderbird/0.5 Mnenhy/0.6.0.104

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Rick Flower wrote:
> OBJDIR =
> OBJDIRS := \
>        ../../${proc}/obj/${target) \
>        ../../${target}/obj \
>        ../../obj/${target}
> 
> find_files  = $(if $(wildcard $(dir)),OBJDIR=${dir})
> OBJDIR := $(foreach dir,$(OBJDIRS),$(find_files))


First, your find_files there is incorrect because of the OBJDIR=${dir}
bit.  If you actually want to assign OBJDIR inside find_files then you
need to wrap it in $(eval).

But from the way you use find_files in the $(foreach) I don't think
that's what you want.

If all you want is to figure out which directory (assuming that only one
exists) from a list of directories in OBJDIRS and store the result in
OBJDIR then you can just do:

OBJDIR := $(wildcard $(OBJDIRS))

John.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2.2 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFGI9C+Lphrp73n/hARAphjAJ4xyHssq2Y4QdpGQsUry+w6fxfchQCg2jwp
JsmixrZYRzw5cFX0uXa+NT4=
=0Jzi
-----END PGP SIGNATURE-----




reply via email to

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