[Lldb-commits] [PATCH] D77662: [lldb/test] Make TestLoadUnload compatible with windows

Pavel Labath via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Thu Apr 9 00:30:48 PDT 2020

labath marked 4 inline comments as done.
labath added inline comments.

Comment at: lldb/packages/Python/lldbsuite/test/make/Makefile.rules:477
 ifeq (1,$(USE_LIBDL))
-	ifneq ($(OS),NetBSD)
+	ifeq (,$(filter $(OS), NetBSD Windows_NT))
 		LDFLAGS += -ldl
amccarth wrote:
> I'm no expert in makefile syntax (especially not for Unix-y versions), but this looks weird, with the leading comma and the matching parenthesis for `$(filter` sitting near the end of the expression.  Is this right?
Yes, it is.

The "leading" comma introduces a empty string as the first argument to `ifeq`. Then the `$filter` thingy will turn `$OS` into an empty string iff it matches one of the strings it got as an argument (technically it will just remove any subwords which match those strings, but since `$OS` is just a single word, the effect is the same). 
So this is a very convoluted way of writing `$(OS) in [NetBSD, Windows_NT]` but:
a) it is consistent with other usages in these makefiles
b) I don't actually know of a better way to write that. If you do, let me know.

  rG LLVM Github Monorepo



More information about the lldb-commits mailing list