Skip to content

Commit 8cce5eb

Browse files
committed
[lldb/Makefile.rules] Force the default target to be 'all'
The test harness invokes the test Makefiles with an explicit 'all' target, but it's handy to be able to recursively call Makefile.rules without speficying a goal. Some time ago, we rewrote some tests in terms of recursive invocations of Makefile.rules. It turns out this had an unintended side effect. While using $(MAKE) for a recursive invocation passes all the variables set on the command line down, it doesn't pass the make goals. This means that those recursive invocations would invoke the default rule. It turns out the default rule of Makefile.rules is not 'all', but $(EXE). This means that ti would work becuase the executable is always needed, but it also means that the created binaries would not follow some of the other top-level build directives, like MAKE_DSYM. Forcing 'all' to be the default target seems easier than making sure all the invocations are correct going forward. This patch does this using the .DEFAULT_GOAL directive rather than hoisting the 'all' rule to be the first one of the file. It seems like this explicit approach will be less prone to be broken in the future. Hopefully all the make implementations we use support it. (cherry picked from commit 509b788)
1 parent 9ffe9df commit 8cce5eb

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

lldb/packages/Python/lldbsuite/test/make/Makefile.rules

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,13 @@ BUILDDIR := $(shell pwd)
3434
THIS_FILE_DIR := $(shell dirname $(lastword $(MAKEFILE_LIST)))
3535
LLDB_BASE_DIR := $(THIS_FILE_DIR)/../../../../../
3636

37+
# The test harness invokes the test Makefiles with an explicit 'all'
38+
# target, but its handy to be able to recursively call this Makefile
39+
# without speficying a goal. You almost certainly want to build 'all',
40+
# and not only the first target defined in this file (which might vary
41+
# according to varaible values).
42+
.DEFAULT_GOAL := all
43+
3744
#----------------------------------------------------------------------
3845
# If OS is not defined, use 'uname -s' to determine the OS name.
3946
#

0 commit comments

Comments
 (0)