All of lore.kernel.org
 help / color / mirror / Atom feed
From: Markus Mayer <code@mmayer.net>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH 1/2] Makefile: don't rely on linux-tools being sorted alphabetically
Date: Tue,  4 Jul 2017 16:54:44 -0700	[thread overview]
Message-ID: <20170704235445.35255-2-code@mmayer.net> (raw)
In-Reply-To: <20170704235445.35255-1-code@mmayer.net>

From: Markus Mayer <mmayer@broadcom.com>

The Linux tools master makefile (linux-tools.mk) must be included after
all Linux tools sub-makefiles (linux-tool-*.mk). This is currently
ensured by sorting all package makefiles alphabetically.

In preparation for adding linux-tool-tmon, we cannot keep relying on
this mechanism. In the C locale, linux-tool-tmon.mk will be sorted
behind linux-tools.mk, which would break the build.

Therefore, we ensure that linux-tools.mk always comes after
linux-tool-*.mk by explicitly including it after the other package
makefiles.

Signed-off-by: Markus Mayer <mmayer@broadcom.com>
---
 Makefile                           | 6 +++++-
 package/linux-tools/linux-tools.mk | 8 +++-----
 2 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/Makefile b/Makefile
index b37171fcf..b5596444d 100644
--- a/Makefile
+++ b/Makefile
@@ -495,7 +495,11 @@ ifneq ($(PACKAGE_OVERRIDE_FILE),)
 -include $(PACKAGE_OVERRIDE_FILE)
 endif
 
-include $(sort $(wildcard package/*/*.mk))
+# We need to insure that linux-tools.mk is included after all linux-tool-*.mk
+# makefiles, and we can't rely on alphabetical sort order for this.
+LINUX_TOOLS_MK = package/linux-tools/linux-tools.mk
+include $(sort $(filter-out $(LINUX_TOOLS_MK),$(wildcard package/*/*.mk)))
+include $(LINUX_TOOLS_MK)
 
 include boot/common.mk
 include linux/linux.mk
diff --git a/package/linux-tools/linux-tools.mk b/package/linux-tools/linux-tools.mk
index 7fa8d194c..3d7a0bd92 100644
--- a/package/linux-tools/linux-tools.mk
+++ b/package/linux-tools/linux-tools.mk
@@ -14,11 +14,9 @@
 # to guarantee that each tool has a chance to register itself before we build
 # the list of build and install hooks, below.
 #
-# This is currently guaranteed by the naming of each file:
-# - they get included by the top-level Makefile, with $(sort $(wildcard ...))
-# - make's $(sort) function will aways sort in the C locale
-# - the files names correctly sort out in the C locale so that each tool's
-#   .mk file is included before this one.
+# This is ensured by the main buildroot makefile, which explicitly includes
+# linux-tools.mk after all linux-tool*.mk makefiles. Look for LINUX_TOOLS_MK
+# in the top-level makefile to see where this is happening.
 
 # We only need the kernel to be extracted, not actually built
 LINUX_TOOLS_PATCH_DEPENDENCIES = linux
-- 
2.13.0

  reply	other threads:[~2017-07-04 23:54 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-04 23:54 [Buildroot] [PATCH 0/2] Add linux-tool-tmon Markus Mayer
2017-07-04 23:54 ` Markus Mayer [this message]
2017-07-05  7:25   ` [Buildroot] [PATCH 1/2] Makefile: don't rely on linux-tools being sorted alphabetically Yann E. MORIN
2017-07-05  7:38     ` Yann E. MORIN
2017-07-05  8:15       ` Arnout Vandecappelle
2017-07-05  8:09     ` Arnout Vandecappelle
2017-07-05  8:18       ` Arnout Vandecappelle
     [not found]         ` <CAGt4E5ueb6x_S4ff=dAeK-x9JnO1SmhnUGz+Q3XKUtj6s24L_Q@mail.gmail.com>
2017-07-05 17:19           ` Markus Mayer
2017-07-08 21:16             ` Arnout Vandecappelle
2017-07-09  0:00               ` Markus Mayer
2017-07-09  8:13             ` Yann E. MORIN
2017-07-09 11:10               ` Arnout Vandecappelle
2017-07-09 12:41                 ` Yann E. MORIN
2017-07-10  3:49                   ` Markus Mayer
2017-07-13 20:16                     ` Markus Mayer
2017-07-13 21:45                       ` Yann E. MORIN
2017-07-13 23:59                         ` Markus Mayer
2017-07-16 15:08                           ` Yann E. MORIN
2017-07-17  7:37                             ` Thomas Petazzoni
2017-07-17 15:36                               ` Yann E. MORIN
2017-07-17 17:32                                 ` Markus Mayer
2017-07-04 23:54 ` [Buildroot] [PATCH 2/2] package/linux-tools: add tmon Markus Mayer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170704235445.35255-2-code@mmayer.net \
    --to=code@mmayer.net \
    --cc=buildroot@busybox.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.