[llvm-commits] [compiler-rt] r116517 - /compiler-rt/trunk/make/util.mk

Daniel Dunbar daniel at zuster.org
Thu Oct 14 14:23:37 PDT 2010


Author: ddunbar
Date: Thu Oct 14 16:23:37 2010
New Revision: 116517

URL: http://llvm.org/viewvc/llvm-project?rev=116517&view=rev
Log:
make: Add CheckCommandLineOverrides to my little Makefile library, a routine for
validating the variables set on the make command line.

Modified:
    compiler-rt/trunk/make/util.mk

Modified: compiler-rt/trunk/make/util.mk
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/make/util.mk?rev=116517&r1=116516&r2=116517&view=diff
==============================================================================
--- compiler-rt/trunk/make/util.mk (original)
+++ compiler-rt/trunk/make/util.mk Thu Oct 14 16:23:37 2010
@@ -88,6 +88,17 @@
   $(if $(call streq,$($(1)),$(2)),,\
        $(error Assertion failed: $(1): $(value $(1)) - $($(1)) != $(2)))
 
+# Function: CheckCommandLineOverrides list
+#
+# Check that all command line variables are in the given list. This routine is
+# useful for validating that users aren't trying to override something which
+# will not work.
+CheckCommandLineOverrides = \
+  $(foreach arg,$(MAKEOVERRIDES),\
+    $(call Set,varname,$(firstword $(subst =, ,$(arg)))) \
+    $(if $(call contains,$(1),$(varname)),,\
+      $(error "Invalid command line override: $(1) $(varname) (not supported)")))
+
 ###
 # Clean up make behavior
 





More information about the llvm-commits mailing list