[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: $(if-eq ...)
From: |
John Graham-Cumming |
Subject: |
Re: $(if-eq ...) |
Date: |
Sat, 30 Jun 2007 15:12:19 +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
Stephan Beal wrote:
> i'm trying to implement an $(if-eq ...) function which goes a little
> something like this:
>
> $(call if-eq,LHS,RHS,THEN[,ELSE])
A simple way to do this is to use the GMSL seq (string equal function)
and then do
$(if $(call seq,LHS,RHS),THEN,ELSE)
Of course you cannot wrap this in a $(call) because THEN and ELSE will
be expanded and if you have any side effects ($(warning), $(error),
$(info), $(shell), $(eval)) in them then that would be undesirable. If
not then
if-eq = $(if $(call seq,$1,$2),$3,$4)
should work fine.
John.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2.2 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQFGhlazLphrp73n/hARAibdAJ0Y+wC9Jn9ma+eDAChZpoF3CqxTUwCfcXQW
qQFgD57cXh3wO9G5BAn5G5U=
=KuDx
-----END PGP SIGNATURE-----
- $(if-eq ...), Stephan Beal, 2007/06/29
- Re: $(if-eq ...),
John Graham-Cumming <=