summaryrefslogtreecommitdiff
path: root/make/util.mk
diff options
context:
space:
mode:
authorDaniel Dunbar <daniel@zuster.org>2010-01-18 06:48:33 +0000
committerDaniel Dunbar <daniel@zuster.org>2010-01-18 06:48:33 +0000
commitfaf0150036689985ecea64e78f2637093857cd7b (patch)
treec73207e736ba2d380094d9b6c51e921578d2d26e /make/util.mk
parentf5722759b8fd2ae65042fe6f87908e3569dbfdf0 (diff)
Simplify subdirectory makefiles, and be more robust by checking that they define the appropriate variables.
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@93714 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'make/util.mk')
-rw-r--r--make/util.mk12
1 files changed, 12 insertions, 0 deletions
diff --git a/make/util.mk b/make/util.mk
index 4f6579084..2ce9a46a2 100644
--- a/make/util.mk
+++ b/make/util.mk
@@ -3,6 +3,18 @@
###
# Utility functions
+# Function: streq LHS RHS
+#
+# Return "true" if LHS == RHS, otherwise "".
+#
+# LHS == RHS <=> (LHS subst RHS is empty) and (RHS subst LHS is empty)
+streq = $(if $(1),$(if $(subst $(1),,$(2))$(subst $(2),,$(1)),,true),$(if $(2),,true))
+
+# Function: strneq LHS RHS
+#
+# Return "true" if LHS != RHS, otherwise "".
+strneq = $(if $(call streq,$(1),$(2)),,true)
+
# Function: Set variable value
#
# Set the given make variable to the given value.