diff options
author | Daniel Dunbar <daniel@zuster.org> | 2010-10-14 21:23:37 +0000 |
---|---|---|
committer | Daniel Dunbar <daniel@zuster.org> | 2010-10-14 21:23:37 +0000 |
commit | 1d16fdede4010acc771695cbcec63aa650564b99 (patch) | |
tree | 4cfe2eee875a959effca0881df14c079103447fa /make | |
parent | 8dd243303ae52a4bd6b389516a412eab32b25516 (diff) | |
download | compiler-rt-1d16fdede4010acc771695cbcec63aa650564b99.tar.gz compiler-rt-1d16fdede4010acc771695cbcec63aa650564b99.tar.bz2 compiler-rt-1d16fdede4010acc771695cbcec63aa650564b99.tar.xz |
make: Add CheckCommandLineOverrides to my little Makefile library, a routine for
validating the variables set on the make command line.
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@116517 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'make')
-rw-r--r-- | make/util.mk | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/make/util.mk b/make/util.mk index 57ff4dae..0687755f 100644 --- a/make/util.mk +++ b/make/util.mk @@ -88,6 +88,17 @@ AssertEqual = \ $(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 |