Bug 735638 - include missing functions for js as well - r=khuey
☠☠ backed out by 88b2925e68b9 ☠ ☠
authorJoey Armstrong <jarmstrong@mozilla.com>
Thu, 12 Apr 2012 18:24:07 -0400
changeset 91507 b7ff20237032b8a202f9a4ce37491eed7be256ea
parent 91506 d26c0cd1dfa3a2c277d8d3713774febff1054db7
child 91508 88b2925e68b9e5b4035d93dc56878158b58fcb3e
push idunknown
push userunknown
push dateunknown
reviewerskhuey
bugs735638
milestone14.0a1
Bug 735638 - include missing functions for js as well - r=khuey
js/src/config/makefiles/makeutils.mk
--- a/js/src/config/makefiles/makeutils.mk
+++ b/js/src/config/makefiles/makeutils.mk
@@ -29,8 +29,22 @@ argv +=)
 ###########################################################################
 ## Access function args as a simple list, inline within user functions.
 ## Usage: $(info ** $(call banner,$(getargv)))
 ##    $(call banner,scalar)
 ##    $(call banner,list0 list1 list2)
 ##    $(call banner,ref) ; ref=foo bar tans
 ## getarglist() would be a more accurate name but is longer to type
 getargv = $(if $(call isvar,$(1)),$($(1)),$(argv))
+
+## http://www.gnu.org/software/make/manual/make.html#Call-Function
+## Usage: o = $(call map,origin,o map $(MAKE))
+map = $(foreach val,$(2),$(call $(1),$(val)))
+
+
+# Usage: $(call checkIfEmpty,[error|warning] foo NULL bar)
+checkIfEmpty =$(foreach var,$(wordlist 2,100,$(getargv)),$(if $(strip $($(var))),$(NOP),$(call $(1),Variable $(var) does not contain a value)))
+
+# Usage: $(call errorIfEmpty,foo NULL bar)
+errorIfEmpty =$(call checkIfEmpty,error $(getargv))
+warnIfEmpty  =$(call checkIfEmpty,warning $(getargv))
+
+