Shawn Halpenny wrote:
define uniq $(strip $(eval tmp:=)$(foreach i,$1,$(eval tmp+=$(if $(filter $i,$(tmp)),,$i))) $(tmp)) endef
That's using $(eval) which means it'll exclude people on GNU Make 3.79.1 or earlier. It's possible to write the some function without $(eval) like this:
uniq = $(if $1,$(call uniq,$(call chop,$1)) $(if $(filter $(call last,$1),$(call chop,$1)),,$(call last,$1)))
(I used the chop and last functions from my GNU Make Standard Library, http://gmsl.sf.net/ so you need to get that and include gmsl to make that uniq function work).
Since this seems like it might be generally useful to people I've checked it into the GMSL CVS repository with tests and it'll be in the next release (whenever that is).
John. -- John Graham-Cumming [EMAIL PROTECTED] Home: http://www.jgc.org/ POPFile: http://getpopfile.org/ Sign up for my Spam and Anti-spam Newsletter at http://www.jgc.org/ _______________________________________________ Help-make mailing list [email protected] http://lists.gnu.org/mailman/listinfo/help-make
