[all-commits] [llvm/llvm-project] 509b78: [lldb/Makefile.rules] Force the default target to ...

fredriss via All-commits all-commits at lists.llvm.org
Fri Jan 17 21:01:17 PST 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 509b78883d4f8fdb13ccc754bba9782d51b477d8
      https://github.com/llvm/llvm-project/commit/509b78883d4f8fdb13ccc754bba9782d51b477d8
  Author: Fred Riss <friss at apple.com>
  Date:   2020-01-17 (Fri, 17 Jan 2020)

  Changed paths:
    M lldb/packages/Python/lldbsuite/test/make/Makefile.rules

  Log Message:
  -----------
  [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.


  Commit: 546f8f426463c7c22a3a8731803a501ff044ba20
      https://github.com/llvm/llvm-project/commit/546f8f426463c7c22a3a8731803a501ff044ba20
  Author: Fred Riss <friss at apple.com>
  Date:   2020-01-17 (Fri, 17 Jan 2020)

  Changed paths:
    M lldb/packages/Python/lldbsuite/test/lang/cpp/incomplete-types/Makefile
    M lldb/packages/Python/lldbsuite/test/lang/objc/ivar-IMP/Makefile

  Log Message:
  -----------
  [lldb/testsuite] Modernize 2 test Makefiles

Those old Makefiles used completely ad-hoc rules for building files,
which means they didn't obey the test harness' variants.

They were somewhat tricky to update as they use very peculiar build
flags for some files. For this reason I was careful to compare the
build commands before and after the change, which is how I found the
discrepancy fixed by the previous commit.

While some of the make syntax used here might not be easy to grasp for
newcomers (per-target variable overrides), it seems better than to
have to repliacte the Makefile.rules logic for the test variants and
platform support.


Compare: https://github.com/llvm/llvm-project/compare/58b10df54ffd...546f8f426463


More information about the All-commits mailing list