From 418a272f4ab4221c37a9272d48fd31d5ac1bddc1 Mon Sep 17 00:00:00 2001 From: Pavel Labath Date: Wed, 4 Sep 2019 07:46:25 +0000 Subject: [dotest] Avoid the need for LEVEL= makefile boilerplate Summary: Instead of each test case knowing its depth relative to the test root, we can just have dotest add the folder containing Makefile.rules to the include path. This was motivated by r370616, though I have been wanting to do this ever since we moved to building tests out-of-tree. The only manually modified files in this patch are lldbinline.py and plugins/builder_base.py. The rest of the patch has been produced by this shell command: find . \( -name Makefile -o -name '*.mk' \) -exec sed --in-place -e '/LEVEL *:\?=/d' -e '1,2{/^$/d}' -e 's,\$(LEVEL)/,,' {} + Reviewers: teemperor, aprantl, espindola, jfb Subscribers: emaste, javed.absar, arichardson, christof, arphaman, lldb-commits Differential Revision: https://reviews.llvm.org/D67083 llvm-svn: 370845 --- lldb/packages/Python/lldbsuite/test/tools/lldb-server/Makefile | 4 +--- .../Python/lldbsuite/test/tools/lldb-server/inferior-crash/Makefile | 4 +--- .../Python/lldbsuite/test/tools/lldb-server/libraries-svr4/Makefile | 4 +--- .../lldbsuite/test/tools/lldb-server/libraries-svr4/svr4lib_a.mk | 4 +--- .../test/tools/lldb-server/libraries-svr4/svr4lib_b_quote.mk | 4 +--- .../test/tools/lldb-server/platform-process-connect/Makefile | 4 +--- .../Python/lldbsuite/test/tools/lldb-server/register-reading/Makefile | 4 +--- .../Python/lldbsuite/test/tools/lldb-server/signal-filtering/Makefile | 4 +--- .../Python/lldbsuite/test/tools/lldb-server/thread-name/Makefile | 4 +--- lldb/packages/Python/lldbsuite/test/tools/lldb-vscode/attach/Makefile | 4 +--- .../Python/lldbsuite/test/tools/lldb-vscode/breakpoint/Makefile | 4 +--- lldb/packages/Python/lldbsuite/test/tools/lldb-vscode/launch/Makefile | 4 +--- .../Python/lldbsuite/test/tools/lldb-vscode/stackTrace/Makefile | 4 +--- lldb/packages/Python/lldbsuite/test/tools/lldb-vscode/step/Makefile | 4 +--- .../Python/lldbsuite/test/tools/lldb-vscode/variables/Makefile | 4 +--- 15 files changed, 15 insertions(+), 45 deletions(-) (limited to 'lldb/packages/Python/lldbsuite/test/tools') diff --git a/lldb/packages/Python/lldbsuite/test/tools/lldb-server/Makefile b/lldb/packages/Python/lldbsuite/test/tools/lldb-server/Makefile index 28aba3cf546..1e0987a3022 100644 --- a/lldb/packages/Python/lldbsuite/test/tools/lldb-server/Makefile +++ b/lldb/packages/Python/lldbsuite/test/tools/lldb-server/Makefile @@ -1,8 +1,6 @@ -LEVEL = ../../make - override CFLAGS_EXTRAS += -D__STDC_LIMIT_MACROS -D__STDC_FORMAT_MACROS ENABLE_THREADS := YES CXX_SOURCES := main.cpp MAKE_DSYM :=NO -include $(LEVEL)/Makefile.rules +include Makefile.rules diff --git a/lldb/packages/Python/lldbsuite/test/tools/lldb-server/inferior-crash/Makefile b/lldb/packages/Python/lldbsuite/test/tools/lldb-server/inferior-crash/Makefile index a47e2797fd8..7fe9a3e92a7 100644 --- a/lldb/packages/Python/lldbsuite/test/tools/lldb-server/inferior-crash/Makefile +++ b/lldb/packages/Python/lldbsuite/test/tools/lldb-server/inferior-crash/Makefile @@ -1,8 +1,6 @@ -LEVEL = ../../../make - CFLAGS_EXTRAS += -D__STDC_LIMIT_MACROS -D__STDC_FORMAT_MACROS -std=c++11 # LD_EXTRAS := -lpthread CXX_SOURCES := main.cpp MAKE_DSYM :=NO -include $(LEVEL)/Makefile.rules +include Makefile.rules diff --git a/lldb/packages/Python/lldbsuite/test/tools/lldb-server/libraries-svr4/Makefile b/lldb/packages/Python/lldbsuite/test/tools/lldb-server/libraries-svr4/Makefile index 265c8ca3c41..e5ed078d1e3 100644 --- a/lldb/packages/Python/lldbsuite/test/tools/lldb-server/libraries-svr4/Makefile +++ b/lldb/packages/Python/lldbsuite/test/tools/lldb-server/libraries-svr4/Makefile @@ -1,12 +1,10 @@ -LEVEL = ../../../make - LIB_PREFIX := svr4lib LD_EXTRAS := -L. -l$(LIB_PREFIX)_a -l$(LIB_PREFIX)_b\" CXX_SOURCES := main.cpp USE_LIBDL := 1 MAKE_DSYM := NO -include $(LEVEL)/Makefile.rules +include Makefile.rules a.out: $(LIB_PREFIX)_a $(LIB_PREFIX)_b_quote diff --git a/lldb/packages/Python/lldbsuite/test/tools/lldb-server/libraries-svr4/svr4lib_a.mk b/lldb/packages/Python/lldbsuite/test/tools/lldb-server/libraries-svr4/svr4lib_a.mk index 626babbd6b2..3d741857c02 100644 --- a/lldb/packages/Python/lldbsuite/test/tools/lldb-server/libraries-svr4/svr4lib_a.mk +++ b/lldb/packages/Python/lldbsuite/test/tools/lldb-server/libraries-svr4/svr4lib_a.mk @@ -1,9 +1,7 @@ -LEVEL = ../../../make - LIB_PREFIX := svr4lib DYLIB_NAME := $(LIB_PREFIX)_a DYLIB_CXX_SOURCES := $(LIB_PREFIX)_a.cpp DYLIB_ONLY := YES -include $(LEVEL)/Makefile.rules +include Makefile.rules diff --git a/lldb/packages/Python/lldbsuite/test/tools/lldb-server/libraries-svr4/svr4lib_b_quote.mk b/lldb/packages/Python/lldbsuite/test/tools/lldb-server/libraries-svr4/svr4lib_b_quote.mk index 5ed7a053b42..fc20cf05c4e 100644 --- a/lldb/packages/Python/lldbsuite/test/tools/lldb-server/libraries-svr4/svr4lib_b_quote.mk +++ b/lldb/packages/Python/lldbsuite/test/tools/lldb-server/libraries-svr4/svr4lib_b_quote.mk @@ -1,9 +1,7 @@ -LEVEL = ../../../make - LIB_PREFIX := svr4lib DYLIB_NAME := $(LIB_PREFIX)_b\" DYLIB_CXX_SOURCES := $(LIB_PREFIX)_b_quote.cpp DYLIB_ONLY := YES -include $(LEVEL)/Makefile.rules +include Makefile.rules diff --git a/lldb/packages/Python/lldbsuite/test/tools/lldb-server/platform-process-connect/Makefile b/lldb/packages/Python/lldbsuite/test/tools/lldb-server/platform-process-connect/Makefile index 314f1cb2f07..99998b20bcb 100644 --- a/lldb/packages/Python/lldbsuite/test/tools/lldb-server/platform-process-connect/Makefile +++ b/lldb/packages/Python/lldbsuite/test/tools/lldb-server/platform-process-connect/Makefile @@ -1,5 +1,3 @@ -LEVEL = ../../../make - CXX_SOURCES := main.cpp -include $(LEVEL)/Makefile.rules +include Makefile.rules diff --git a/lldb/packages/Python/lldbsuite/test/tools/lldb-server/register-reading/Makefile b/lldb/packages/Python/lldbsuite/test/tools/lldb-server/register-reading/Makefile index 314f1cb2f07..99998b20bcb 100644 --- a/lldb/packages/Python/lldbsuite/test/tools/lldb-server/register-reading/Makefile +++ b/lldb/packages/Python/lldbsuite/test/tools/lldb-server/register-reading/Makefile @@ -1,5 +1,3 @@ -LEVEL = ../../../make - CXX_SOURCES := main.cpp -include $(LEVEL)/Makefile.rules +include Makefile.rules diff --git a/lldb/packages/Python/lldbsuite/test/tools/lldb-server/signal-filtering/Makefile b/lldb/packages/Python/lldbsuite/test/tools/lldb-server/signal-filtering/Makefile index 314f1cb2f07..99998b20bcb 100644 --- a/lldb/packages/Python/lldbsuite/test/tools/lldb-server/signal-filtering/Makefile +++ b/lldb/packages/Python/lldbsuite/test/tools/lldb-server/signal-filtering/Makefile @@ -1,5 +1,3 @@ -LEVEL = ../../../make - CXX_SOURCES := main.cpp -include $(LEVEL)/Makefile.rules +include Makefile.rules diff --git a/lldb/packages/Python/lldbsuite/test/tools/lldb-server/thread-name/Makefile b/lldb/packages/Python/lldbsuite/test/tools/lldb-server/thread-name/Makefile index 8817fff55e8..de4ec12b13c 100644 --- a/lldb/packages/Python/lldbsuite/test/tools/lldb-server/thread-name/Makefile +++ b/lldb/packages/Python/lldbsuite/test/tools/lldb-server/thread-name/Makefile @@ -1,6 +1,4 @@ -LEVEL = ../../../make - ENABLE_THREADS := YES CXX_SOURCES := main.cpp -include $(LEVEL)/Makefile.rules +include Makefile.rules diff --git a/lldb/packages/Python/lldbsuite/test/tools/lldb-vscode/attach/Makefile b/lldb/packages/Python/lldbsuite/test/tools/lldb-vscode/attach/Makefile index b09a579159d..10495940055 100644 --- a/lldb/packages/Python/lldbsuite/test/tools/lldb-vscode/attach/Makefile +++ b/lldb/packages/Python/lldbsuite/test/tools/lldb-vscode/attach/Makefile @@ -1,5 +1,3 @@ -LEVEL = ../../../make - C_SOURCES := main.c -include $(LEVEL)/Makefile.rules +include Makefile.rules diff --git a/lldb/packages/Python/lldbsuite/test/tools/lldb-vscode/breakpoint/Makefile b/lldb/packages/Python/lldbsuite/test/tools/lldb-vscode/breakpoint/Makefile index 314f1cb2f07..99998b20bcb 100644 --- a/lldb/packages/Python/lldbsuite/test/tools/lldb-vscode/breakpoint/Makefile +++ b/lldb/packages/Python/lldbsuite/test/tools/lldb-vscode/breakpoint/Makefile @@ -1,5 +1,3 @@ -LEVEL = ../../../make - CXX_SOURCES := main.cpp -include $(LEVEL)/Makefile.rules +include Makefile.rules diff --git a/lldb/packages/Python/lldbsuite/test/tools/lldb-vscode/launch/Makefile b/lldb/packages/Python/lldbsuite/test/tools/lldb-vscode/launch/Makefile index b09a579159d..10495940055 100644 --- a/lldb/packages/Python/lldbsuite/test/tools/lldb-vscode/launch/Makefile +++ b/lldb/packages/Python/lldbsuite/test/tools/lldb-vscode/launch/Makefile @@ -1,5 +1,3 @@ -LEVEL = ../../../make - C_SOURCES := main.c -include $(LEVEL)/Makefile.rules +include Makefile.rules diff --git a/lldb/packages/Python/lldbsuite/test/tools/lldb-vscode/stackTrace/Makefile b/lldb/packages/Python/lldbsuite/test/tools/lldb-vscode/stackTrace/Makefile index b09a579159d..10495940055 100644 --- a/lldb/packages/Python/lldbsuite/test/tools/lldb-vscode/stackTrace/Makefile +++ b/lldb/packages/Python/lldbsuite/test/tools/lldb-vscode/stackTrace/Makefile @@ -1,5 +1,3 @@ -LEVEL = ../../../make - C_SOURCES := main.c -include $(LEVEL)/Makefile.rules +include Makefile.rules diff --git a/lldb/packages/Python/lldbsuite/test/tools/lldb-vscode/step/Makefile b/lldb/packages/Python/lldbsuite/test/tools/lldb-vscode/step/Makefile index f24bb9f4d26..b7f3072e28c 100644 --- a/lldb/packages/Python/lldbsuite/test/tools/lldb-vscode/step/Makefile +++ b/lldb/packages/Python/lldbsuite/test/tools/lldb-vscode/step/Makefile @@ -1,7 +1,5 @@ -LEVEL = ../../../make - ENABLE_THREADS := YES CXX_SOURCES := main.cpp -include $(LEVEL)/Makefile.rules +include Makefile.rules diff --git a/lldb/packages/Python/lldbsuite/test/tools/lldb-vscode/variables/Makefile b/lldb/packages/Python/lldbsuite/test/tools/lldb-vscode/variables/Makefile index 314f1cb2f07..99998b20bcb 100644 --- a/lldb/packages/Python/lldbsuite/test/tools/lldb-vscode/variables/Makefile +++ b/lldb/packages/Python/lldbsuite/test/tools/lldb-vscode/variables/Makefile @@ -1,5 +1,3 @@ -LEVEL = ../../../make - CXX_SOURCES := main.cpp -include $(LEVEL)/Makefile.rules +include Makefile.rules -- cgit v1.2.3