[Lldb-commits] [PATCH] D68558: [Testsuite] Get rid of most of the recursive shared library Makefiles

2019-10-08 Thread Frederic Riss via Phabricator via lldb-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rG3fb4e49a68f5: [Testsuite] Get rid of most of the recursive 
shared library Makefiles (authored by friss).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D68558/new/

https://reviews.llvm.org/D68558

Files:
  lldb/packages/Python/lldbsuite/test/commands/expression/top-level/Makefile
  lldb/packages/Python/lldbsuite/test/commands/expression/top-level/dummy.mk
  lldb/packages/Python/lldbsuite/test/commands/target/create-deps/Makefile
  lldb/packages/Python/lldbsuite/test/commands/target/create-deps/a.mk
  lldb/packages/Python/lldbsuite/test/functionalities/exec/Makefile
  lldb/packages/Python/lldbsuite/test/functionalities/exec/secondprog.mk
  lldb/packages/Python/lldbsuite/test/functionalities/jitloader_gdb/Makefile
  lldb/packages/Python/lldbsuite/test/functionalities/jitloader_gdb/simple.mk
  lldb/packages/Python/lldbsuite/test/functionalities/load_unload/Makefile
  lldb/packages/Python/lldbsuite/test/functionalities/load_unload/a.mk
  lldb/packages/Python/lldbsuite/test/functionalities/load_unload/b.mk
  lldb/packages/Python/lldbsuite/test/functionalities/load_unload/c.mk
  lldb/packages/Python/lldbsuite/test/functionalities/load_unload/d.mk
  lldb/packages/Python/lldbsuite/test/functionalities/load_using_paths/Makefile
  lldb/packages/Python/lldbsuite/test/lang/cpp/namespace_definitions/Makefile
  lldb/packages/Python/lldbsuite/test/lang/cpp/namespace_definitions/a.mk
  lldb/packages/Python/lldbsuite/test/lang/cpp/namespace_definitions/b.mk
  lldb/packages/Python/lldbsuite/test/lang/objc/conflicting-definition/Makefile
  
lldb/packages/Python/lldbsuite/test/lang/objc/conflicting-definition/Test/Test.mk
  
lldb/packages/Python/lldbsuite/test/lang/objc/conflicting-definition/TestExt/TestExt.mk
  lldb/packages/Python/lldbsuite/test/macosx/lc-note/kern-ver-str/Makefile
  
lldb/packages/Python/lldbsuite/test/macosx/lc-note/kern-ver-str/create-empty-corefile.mk
  lldb/packages/Python/lldbsuite/test/macosx/macabi/Makefile
  lldb/packages/Python/lldbsuite/test/macosx/macabi/dylib.mk
  lldb/packages/Python/lldbsuite/test/make/Makefile.rules
  lldb/packages/Python/lldbsuite/test/tools/lldb-server/libraries-svr4/Makefile
  
lldb/packages/Python/lldbsuite/test/tools/lldb-server/libraries-svr4/svr4lib_a.mk
  
lldb/packages/Python/lldbsuite/test/tools/lldb-server/libraries-svr4/svr4lib_b_quote.mk

Index: lldb/packages/Python/lldbsuite/test/tools/lldb-server/libraries-svr4/svr4lib_b_quote.mk
===
--- lldb/packages/Python/lldbsuite/test/tools/lldb-server/libraries-svr4/svr4lib_b_quote.mk
+++ /dev/null
@@ -1,7 +0,0 @@
-LIB_PREFIX := svr4lib
-
-DYLIB_NAME := $(LIB_PREFIX)_b\"
-DYLIB_CXX_SOURCES := $(LIB_PREFIX)_b_quote.cpp
-DYLIB_ONLY := YES
-
-include Makefile.rules
Index: lldb/packages/Python/lldbsuite/test/tools/lldb-server/libraries-svr4/svr4lib_a.mk
===
--- lldb/packages/Python/lldbsuite/test/tools/lldb-server/libraries-svr4/svr4lib_a.mk
+++ /dev/null
@@ -1,7 +0,0 @@
-LIB_PREFIX := svr4lib
-
-DYLIB_NAME := $(LIB_PREFIX)_a
-DYLIB_CXX_SOURCES := $(LIB_PREFIX)_a.cpp
-DYLIB_ONLY := YES
-
-include Makefile.rules
Index: lldb/packages/Python/lldbsuite/test/tools/lldb-server/libraries-svr4/Makefile
===
--- lldb/packages/Python/lldbsuite/test/tools/lldb-server/libraries-svr4/Makefile
+++ lldb/packages/Python/lldbsuite/test/tools/lldb-server/libraries-svr4/Makefile
@@ -1,15 +1,19 @@
 LIB_PREFIX := svr4lib
-LD_EXTRAS := -L. -l$(LIB_PREFIX)_a -l$(LIB_PREFIX)_b\"
+LD_EXTRAS := -L. -lsvr4lib_a -lsvr4lib_b\"
 CXX_SOURCES := main.cpp
 USE_LIBDL := 1
 MAKE_DSYM := NO
 
-include Makefile.rules
+a.out: svr4lib_a svr4lib_b_quote
 
-a.out: $(LIB_PREFIX)_a $(LIB_PREFIX)_b_quote
+include Makefile.rules
 
-svr4lib_%:
-	$(MAKE) VPATH=$(SRCDIR) -I $(SRCDIR) -f "$(SRCDIR)/$(LIB_PREFIX)_$*.mk"
+svr4lib_a:
+	$(MAKE) -f $(MAKEFILE_RULES) \
+		DYLIB_NAME=svr4lib_a DYLIB_CXX_SOURCES=svr4lib_a.cpp \
+		DYLIB_ONLY=YES
 
-clean::
-	$(MAKE) -f $(SRCDIR)/$(LIB_PREFIX)_a.mk clean
+svr4lib_b_quote:
+	$(MAKE) -f $(MAKEFILE_RULES) \
+		DYLIB_NAME=svr4lib_b\\\" DYLIB_CXX_SOURCES=svr4lib_b_quote.cpp \
+		DYLIB_ONLY=YES
Index: lldb/packages/Python/lldbsuite/test/make/Makefile.rules
===
--- lldb/packages/Python/lldbsuite/test/make/Makefile.rules
+++ lldb/packages/Python/lldbsuite/test/make/Makefile.rules
@@ -36,7 +36,8 @@
 
 SRCDIR := $(shell dirname $(firstword $(MAKEFILE_LIST)))
 BUILDDIR := $(shell pwd)
-THIS_FILE_DIR := $(shell dirname $(lastword $(MAKEFILE_LIST)))
+MAKEFILE_RULES := $(lastword $(MAKEFILE_LIST))
+THIS_FILE_DIR := $(shell dirname $(MAKEFILE_RULES))
 LLDB_BASE_DIR := $(THIS_FILE_DIR)/../../../../../
 
 

[Lldb-commits] [PATCH] D68558: [Testsuite] Get rid of most of the recursive shared library Makefiles

2019-10-07 Thread Jonas Devlieghere via Phabricator via lldb-commits
JDevlieghere added a comment.

Thanks, LGTM!


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D68558/new/

https://reviews.llvm.org/D68558



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D68558: [Testsuite] Get rid of most of the recursive shared library Makefiles

2019-10-07 Thread Adrian Prantl via Phabricator via lldb-commits
aprantl accepted this revision.
aprantl added a comment.
This revision is now accepted and ready to land.

> We don't delete $(BUILDDIR), we delete what's inside of it.

Sorry, I missed that detail!


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D68558/new/

https://reviews.llvm.org/D68558



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D68558: [Testsuite] Get rid of most of the recursive shared library Makefiles

2019-10-07 Thread Frederic Riss via Phabricator via lldb-commits
friss marked an inline comment as done.
friss added inline comments.



Comment at: lldb/packages/Python/lldbsuite/test/make/Makefile.rules:771
 else
-   $(RM) "$(EXE)"
+   $(RM) -r $(wildcard $(BUILDDIR)/*)
 endif

aprantl wrote:
> I would just error, period. IMHO `make clean` shouldn'd delete anything that 
> `make` doesn't know how to rebuild and I don't think we have any rule to 
> restore `$(BUILDDIR)`, do we?
We don't delete $(BUILDDIR), we delete what's inside of it. I would have gotten 
rid of the rule completely, but having a `clean` rule is handy in one 
circumstance:  when iterating over the build of a new test (or like I did last 
week rework a lot of existing test builds). There you want to be able to run 
the make command by itself, and being able to quickly iterate with `make clean 
all` is really nice. I don't think we're taking any risk here as the rule 
checks whether we are inside a directory that dotest is going to wipe anyway.  


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D68558/new/

https://reviews.llvm.org/D68558



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D68558: [Testsuite] Get rid of most of the recursive shared library Makefiles

2019-10-07 Thread Adrian Prantl via Phabricator via lldb-commits
aprantl added inline comments.



Comment at: lldb/packages/Python/lldbsuite/test/make/Makefile.rules:771
 else
-   $(RM) "$(EXE)"
+   $(RM) -r $(wildcard $(BUILDDIR)/*)
 endif

I would just error, period. IMHO `make clean` shouldn'd delete anything that 
`make` doesn't know how to rebuild and I don't think we have any rule to 
restore `$(BUILDDIR)`, do we?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D68558/new/

https://reviews.llvm.org/D68558



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D68558: [Testsuite] Get rid of most of the recursive shared library Makefiles

2019-10-07 Thread Frederic Riss via Phabricator via lldb-commits
friss updated this revision to Diff 223683.
friss added a comment.

Addressed review feedback.

Completely removed the clean code for the Makefiles and reworked it in
Makefile.rules to be much simpler and catch-all.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D68558/new/

https://reviews.llvm.org/D68558

Files:
  lldb/packages/Python/lldbsuite/test/commands/expression/top-level/Makefile
  lldb/packages/Python/lldbsuite/test/commands/expression/top-level/dummy.mk
  lldb/packages/Python/lldbsuite/test/commands/target/create-deps/Makefile
  lldb/packages/Python/lldbsuite/test/commands/target/create-deps/a.mk
  lldb/packages/Python/lldbsuite/test/functionalities/exec/Makefile
  lldb/packages/Python/lldbsuite/test/functionalities/exec/secondprog.mk
  lldb/packages/Python/lldbsuite/test/functionalities/jitloader_gdb/Makefile
  lldb/packages/Python/lldbsuite/test/functionalities/jitloader_gdb/simple.mk
  lldb/packages/Python/lldbsuite/test/functionalities/load_unload/Makefile
  lldb/packages/Python/lldbsuite/test/functionalities/load_unload/a.mk
  lldb/packages/Python/lldbsuite/test/functionalities/load_unload/b.mk
  lldb/packages/Python/lldbsuite/test/functionalities/load_unload/c.mk
  lldb/packages/Python/lldbsuite/test/functionalities/load_unload/d.mk
  lldb/packages/Python/lldbsuite/test/functionalities/load_using_paths/Makefile
  lldb/packages/Python/lldbsuite/test/lang/cpp/namespace_definitions/Makefile
  lldb/packages/Python/lldbsuite/test/lang/cpp/namespace_definitions/a.mk
  lldb/packages/Python/lldbsuite/test/lang/cpp/namespace_definitions/b.mk
  lldb/packages/Python/lldbsuite/test/lang/objc/conflicting-definition/Makefile
  
lldb/packages/Python/lldbsuite/test/lang/objc/conflicting-definition/Test/Test.mk
  
lldb/packages/Python/lldbsuite/test/lang/objc/conflicting-definition/TestExt/TestExt.mk
  lldb/packages/Python/lldbsuite/test/macosx/lc-note/kern-ver-str/Makefile
  
lldb/packages/Python/lldbsuite/test/macosx/lc-note/kern-ver-str/create-empty-corefile.mk
  lldb/packages/Python/lldbsuite/test/macosx/macabi/Makefile
  lldb/packages/Python/lldbsuite/test/macosx/macabi/dylib.mk
  lldb/packages/Python/lldbsuite/test/make/Makefile.rules
  lldb/packages/Python/lldbsuite/test/tools/lldb-server/libraries-svr4/Makefile
  
lldb/packages/Python/lldbsuite/test/tools/lldb-server/libraries-svr4/svr4lib_a.mk
  
lldb/packages/Python/lldbsuite/test/tools/lldb-server/libraries-svr4/svr4lib_b_quote.mk

Index: lldb/packages/Python/lldbsuite/test/tools/lldb-server/libraries-svr4/svr4lib_b_quote.mk
===
--- lldb/packages/Python/lldbsuite/test/tools/lldb-server/libraries-svr4/svr4lib_b_quote.mk
+++ /dev/null
@@ -1,7 +0,0 @@
-LIB_PREFIX := svr4lib
-
-DYLIB_NAME := $(LIB_PREFIX)_b\"
-DYLIB_CXX_SOURCES := $(LIB_PREFIX)_b_quote.cpp
-DYLIB_ONLY := YES
-
-include Makefile.rules
Index: lldb/packages/Python/lldbsuite/test/tools/lldb-server/libraries-svr4/svr4lib_a.mk
===
--- lldb/packages/Python/lldbsuite/test/tools/lldb-server/libraries-svr4/svr4lib_a.mk
+++ /dev/null
@@ -1,7 +0,0 @@
-LIB_PREFIX := svr4lib
-
-DYLIB_NAME := $(LIB_PREFIX)_a
-DYLIB_CXX_SOURCES := $(LIB_PREFIX)_a.cpp
-DYLIB_ONLY := YES
-
-include Makefile.rules
Index: lldb/packages/Python/lldbsuite/test/tools/lldb-server/libraries-svr4/Makefile
===
--- lldb/packages/Python/lldbsuite/test/tools/lldb-server/libraries-svr4/Makefile
+++ lldb/packages/Python/lldbsuite/test/tools/lldb-server/libraries-svr4/Makefile
@@ -1,15 +1,19 @@
 LIB_PREFIX := svr4lib
-LD_EXTRAS := -L. -l$(LIB_PREFIX)_a -l$(LIB_PREFIX)_b\"
+LD_EXTRAS := -L. -lsvr4lib_a -lsvr4lib_b\"
 CXX_SOURCES := main.cpp
 USE_LIBDL := 1
 MAKE_DSYM := NO
 
-include Makefile.rules
+a.out: svr4lib_a svr4lib_b_quote
 
-a.out: $(LIB_PREFIX)_a $(LIB_PREFIX)_b_quote
+include Makefile.rules
 
-svr4lib_%:
-	$(MAKE) VPATH=$(SRCDIR) -I $(SRCDIR) -f "$(SRCDIR)/$(LIB_PREFIX)_$*.mk"
+svr4lib_a:
+	$(MAKE) -f $(MAKEFILE_RULES) \
+		DYLIB_NAME=svr4lib_a DYLIB_CXX_SOURCES=svr4lib_a.cpp \
+		DYLIB_ONLY=YES
 
-clean::
-	$(MAKE) -f $(SRCDIR)/$(LIB_PREFIX)_a.mk clean
+svr4lib_b_quote:
+	$(MAKE) -f $(MAKEFILE_RULES) \
+		DYLIB_NAME=svr4lib_b\\\" DYLIB_CXX_SOURCES=svr4lib_b_quote.cpp \
+		DYLIB_ONLY=YES
Index: lldb/packages/Python/lldbsuite/test/make/Makefile.rules
===
--- lldb/packages/Python/lldbsuite/test/make/Makefile.rules
+++ lldb/packages/Python/lldbsuite/test/make/Makefile.rules
@@ -36,7 +36,8 @@
 
 SRCDIR := $(shell dirname $(firstword $(MAKEFILE_LIST)))
 BUILDDIR := $(shell pwd)
-THIS_FILE_DIR := $(shell dirname $(lastword $(MAKEFILE_LIST)))
+MAKEFILE_RULES := $(lastword $(MAKEFILE_LIST))
+THIS_FILE_DIR := $(shell dirname $(MAKEFILE_RULES))
 LLDB_BASE_DIR := $(THIS_FILE_DIR)/../../../../../
 
 

[Lldb-commits] [PATCH] D68558: [Testsuite] Get rid of most of the recursive shared library Makefiles

2019-10-07 Thread Jonas Devlieghere via Phabricator via lldb-commits
JDevlieghere added a comment.

In D68558#1698031 , @friss wrote:

> Pretty sure the test runs don't need the clean rule, but it's nice to have 
> when manually iterating over the build phase of a test. OTOH, manually doing 
> a "rm -rf" of the build directory is not a big burden.
>
> Anybody else objects to getting rid of the clean rules?


I like having the clean rule when I'm debugging a particular test and I'm 
messing with the Makefile. I don't mind having to manually remove the build 
directory, but it seems like we could just make that the top-level clean rule. 
If we go that route, let's put in a safeguard so that you don't accidentally 
remove your current working directory if you forget to pass the `-C` flag.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D68558/new/

https://reviews.llvm.org/D68558



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D68558: [Testsuite] Get rid of most of the recursive shared library Makefiles

2019-10-07 Thread Frederic Riss via Phabricator via lldb-commits
friss added a comment.

In D68558#1697890 , @labath wrote:

> I like the idea of passing the variable values "inline". The MAKECMDGOALS 
> thingy seems... clever. I sort of like it, and it also feels like it might be 
> too much.


This is why I didn't commit this without review, I do feel the same.

> do we actually need a functional clean rule? I was under the impression that 
> ever since we moved tests to build out-of-tree the clean rule doesn't do much 
> and isn't even being invoked by default. Should we just delete the clean 
> rules altogether? The handful of tests that actually want to clean and 
> rebuild as a part of the test can do something custom...

Pretty sure the test runs don't need the clean rule, but it's nice to have when 
manually iterating over the build phase of a test. OTOH, manually doing a "rm 
-rf" of the build directory is not a big burden.

Anybody else objects to getting rid of the clean rules?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D68558/new/

https://reviews.llvm.org/D68558



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D68558: [Testsuite] Get rid of most of the recursive shared library Makefiles

2019-10-07 Thread Adrian Prantl via Phabricator via lldb-commits
aprantl added a comment.

This is some really tricky Make (wow), but I think the benefit of it being so 
much shorter and localized outweighs the steeper learning curve. Thanks!




Comment at: 
lldb/packages/Python/lldbsuite/test/commands/expression/top-level/Makefile:9
+   $(MAKE) -f $(MAKEFILE_RULES) \
+   CXX_SOURCES=dummy.cpp EXE=dummy $(MAKECMDGOALS)
 

Can you make sure that this is passing what's necessary by removing the default 
rule from Makefile.rules that initializes `CC ?=`



Comment at: 
lldb/packages/Python/lldbsuite/test/commands/target/create-deps/Makefile:1
-LIB_PREFIX := load_
-
-LD_EXTRAS := -L. -l$(LIB_PREFIX)a
+LD_EXTRAS := -L. -lload_a
 CXX_SOURCES := main.cpp

`= -L$(BUILDDIR)` ?
Perhaps `:= -L.` is preferable.



Comment at: 
lldb/packages/Python/lldbsuite/test/lang/cpp/namespace_definitions/Makefile:1
 LD_EXTRAS := -L. -l$(LIB_PREFIX)a -l$(LIB_PREFIX)b
 CXX_SOURCES := main.cpp

Is $(LIBPREFIX) available here? shouldn't this be `=` instead?



Comment at: 
lldb/packages/Python/lldbsuite/test/lang/objc/conflicting-definition/Makefile:1
-LD_EXTRAS = -lobjc -framework Foundation
-
-include Makefile.rules
+LD_EXTRAS = -lobjc -framework Foundation -L. -lTest -lTestExt
+OBJC_SOURCES = main.m

:= and $(BUILDDIR)



Comment at: 
lldb/packages/Python/lldbsuite/test/lang/objc/conflicting-definition/Makefile:2
+LD_EXTRAS = -lobjc -framework Foundation -L. -lTest -lTestExt
+OBJC_SOURCES = main.m
 

:=



Comment at: 
lldb/packages/Python/lldbsuite/test/lang/objc/conflicting-definition/Makefile:8
+
+libTest.dylib clean::  Test/Test.m
mkdir -p Test

Let's move these past the `include Makefile.rules` for symmetry.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D68558/new/

https://reviews.llvm.org/D68558



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D68558: [Testsuite] Get rid of most of the recursive shared library Makefiles

2019-10-07 Thread Pavel Labath via Phabricator via lldb-commits
labath added a comment.

I like the idea of passing the variable values "inline". The MAKECMDGOALS 
thingy seems... clever. I sort of like it, and it also feels like it might be 
too much. I suppose that is fine, but.. do we actually need a functional clean 
rule? I was under the impression that ever since we moved tests to build 
out-of-tree the clean rule doesn't do much and isn't even being invoked by 
default. Should we just delete the clean rules altogether? The handful of tests 
that actually want to clean and rebuild as a part of the test can do something 
custom...


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D68558/new/

https://reviews.llvm.org/D68558



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D68558: [Testsuite] Get rid of most of the recursive shared library Makefiles

2019-10-06 Thread Frederic Riss via Phabricator via lldb-commits
friss created this revision.
friss added reviewers: aprantl, labath.
Herald added a project: LLDB.

I was working on cleaning up our on-device test runs last week, and as
a result I needed to update a lot of test Makefiles in the Swift
tree. I found it especailly annoying to update the build system of
tests that are building mutliple images (typically a shared
library).

The main reason is that you can't see what's (if anything) special
about the build from the main makefile. You always need to open
mutliple Makefiles. Another reason is the way you have to add a
special line to your clean rule to do the right thing, and you never
really know which arguments to pass.

Most of the secondary Makefiles we have are just a couple variable
definitions and then an include of Makefile.rules. This patch removes
most of the secondary Makefiles and replaces them with a direct
invocation of Makefile.rules in the main Makefile. The specificities
of each sub-build are listed right there on the recursive $(MAKE)
call. All the variables that matter are being passed automagically by
make as they have been passed on the command line. The only things you
need to specify are the variables customizating the Makefile.rules
logic for each image.

This patch also deals with the clean rules using this trick to avoid
having to duplicate the recursive invocation in a separate clean rule:

mylib clean::

  $(MAKE) -f $(MAKEFILE_RULES) ... $(MAKECMDGOALS)

The MAKECMDGOALS variable at the end contains the list of build goals
that have been passed on the command line. When it's empty, this
invocation just calls the default Makefile.rules rule which is what
you want. When "clean" is passed as a goal, the rule will be invoked
too and it is passed through MAKECMDGOALS invoking the appropriate
cleaning logic from Makefile.rules.

I really like the conciseness of this approach and the fact that
everything is visible in one place. What do others think?


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D68558

Files:
  lldb/packages/Python/lldbsuite/test/commands/expression/top-level/Makefile
  lldb/packages/Python/lldbsuite/test/commands/expression/top-level/dummy.mk
  lldb/packages/Python/lldbsuite/test/commands/target/create-deps/Makefile
  lldb/packages/Python/lldbsuite/test/commands/target/create-deps/a.mk
  lldb/packages/Python/lldbsuite/test/functionalities/exec/Makefile
  lldb/packages/Python/lldbsuite/test/functionalities/exec/secondprog.mk
  lldb/packages/Python/lldbsuite/test/functionalities/jitloader_gdb/Makefile
  lldb/packages/Python/lldbsuite/test/functionalities/jitloader_gdb/simple.mk
  lldb/packages/Python/lldbsuite/test/functionalities/load_unload/Makefile
  lldb/packages/Python/lldbsuite/test/functionalities/load_unload/a.mk
  lldb/packages/Python/lldbsuite/test/functionalities/load_unload/b.mk
  lldb/packages/Python/lldbsuite/test/functionalities/load_unload/c.mk
  lldb/packages/Python/lldbsuite/test/functionalities/load_unload/d.mk
  lldb/packages/Python/lldbsuite/test/functionalities/load_using_paths/Makefile
  lldb/packages/Python/lldbsuite/test/lang/cpp/namespace_definitions/Makefile
  lldb/packages/Python/lldbsuite/test/lang/cpp/namespace_definitions/a.mk
  lldb/packages/Python/lldbsuite/test/lang/cpp/namespace_definitions/b.mk
  lldb/packages/Python/lldbsuite/test/lang/objc/conflicting-definition/Makefile
  
lldb/packages/Python/lldbsuite/test/lang/objc/conflicting-definition/Test/Test.mk
  
lldb/packages/Python/lldbsuite/test/lang/objc/conflicting-definition/TestExt/TestExt.mk
  lldb/packages/Python/lldbsuite/test/macosx/lc-note/kern-ver-str/Makefile
  
lldb/packages/Python/lldbsuite/test/macosx/lc-note/kern-ver-str/create-empty-corefile.mk
  lldb/packages/Python/lldbsuite/test/macosx/macabi/Makefile
  lldb/packages/Python/lldbsuite/test/macosx/macabi/dylib.mk
  lldb/packages/Python/lldbsuite/test/make/Makefile.rules
  lldb/packages/Python/lldbsuite/test/tools/lldb-server/libraries-svr4/Makefile
  
lldb/packages/Python/lldbsuite/test/tools/lldb-server/libraries-svr4/svr4lib_a.mk
  
lldb/packages/Python/lldbsuite/test/tools/lldb-server/libraries-svr4/svr4lib_b_quote.mk

Index: lldb/packages/Python/lldbsuite/test/tools/lldb-server/libraries-svr4/svr4lib_b_quote.mk
===
--- lldb/packages/Python/lldbsuite/test/tools/lldb-server/libraries-svr4/svr4lib_b_quote.mk
+++ /dev/null
@@ -1,7 +0,0 @@
-LIB_PREFIX := svr4lib
-
-DYLIB_NAME := $(LIB_PREFIX)_b\"
-DYLIB_CXX_SOURCES := $(LIB_PREFIX)_b_quote.cpp
-DYLIB_ONLY := YES
-
-include Makefile.rules
Index: lldb/packages/Python/lldbsuite/test/tools/lldb-server/libraries-svr4/svr4lib_a.mk
===
--- lldb/packages/Python/lldbsuite/test/tools/lldb-server/libraries-svr4/svr4lib_a.mk
+++ /dev/null
@@ -1,7 +0,0 @@
-LIB_PREFIX := svr4lib
-
-DYLIB_NAME := $(LIB_PREFIX)_a
-DYLIB_CXX_SOURCES := $(LIB_PREFIX)_a.cpp
-DYLIB_ONLY := YES
-
-include