From patchwork Thu Sep 22 16:28:06 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Yann E. MORIN" X-Patchwork-Id: 673528 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3sg23n1yJTz9rxm for ; Fri, 23 Sep 2016 02:28:20 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b=HIl/s7vm; dkim-atps=neutral Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id A548A8AF27; Thu, 22 Sep 2016 16:28:17 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id y-w7LYjJbwsE; Thu, 22 Sep 2016 16:28:16 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by hemlock.osuosl.org (Postfix) with ESMTP id 8E7B88AF26; Thu, 22 Sep 2016 16:28:16 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) by ash.osuosl.org (Postfix) with ESMTP id 8A36B1C251D for ; Thu, 22 Sep 2016 16:28:14 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 898528B667 for ; Thu, 22 Sep 2016 16:28:14 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id KDfoMPYxZTYO for ; Thu, 22 Sep 2016 16:28:13 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-wm0-f66.google.com (mail-wm0-f66.google.com [74.125.82.66]) by whitealder.osuosl.org (Postfix) with ESMTPS id 9E2458B4BC for ; Thu, 22 Sep 2016 16:28:13 +0000 (UTC) Received: by mail-wm0-f66.google.com with SMTP id l132so14907216wmf.1 for ; Thu, 22 Sep 2016 09:28:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id; bh=w1ZVCEakqjC9F+uNl9sT42WHrQEufYS8UlXQi3Uxm4s=; b=HIl/s7vm+8D74cRJEU0nlpMfv4IdYmLYq1tKO+7zswLLV4+NnLg+fqZUemiEFoCxkI 0XT0MdAVXqDadG+3BJAHcmSIIY4McfegxCpMSJDpq2SG1UR5XcbjG8s8iSceY+X87iuj /RXqP6MWD2VqfpuJn1HvLFzjPccCuTXmgSJjY4BssNOrq+Wn7S/d9j3pcpgbedNOBwvw KLiwnzQYDc+WBsOvVwlr3b4r2mSaI2WrkWZAg1SptTkasonD5Tfy0IUz2t+1tJRPl8F+ JQR/Ysnwf2v2xp4Z5dEsYpmLOaQ0ZAgzkuLkZBOgFp6YN9C4gaVKLun8pqmN6aSst6ll ynKw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id; bh=w1ZVCEakqjC9F+uNl9sT42WHrQEufYS8UlXQi3Uxm4s=; b=hfD4YQ9Q1d0YbE9BfnFWVJ9BzNJ1Ku6qTd+pEjYIK3+SgNxPZozWLm7jzLrWbWcZNX aXTuYDDyFSzAGXOTz6Y49sYWzqgjDYVeV2mE1jYrwpCIH8cliPD+Z/iC5NypUfyHKuit hfbBdZ75YVHRi4u0mUqNuK6FtUFsEPiO8IgXC+fHIvBIl3wsOg8KeIQobusa/TBPxMdY O9iv54WsUhzW2VbDkTgESzIyKCJy1x03pt4U5J79b7KIuL1WA98XAqKJalaXOuIpLYIb 1vF2YUaoQD3PRLJMgNOpcrbZc1pwmCU+CFpvW8qfy6OTOHjurNDHykyBAPdup70TZyWn kumA== X-Gm-Message-State: AE9vXwPOjOL421A1B5n+yFTk+QXX8MbWxzMOZfMoOTSAY/WHSyx++9pWclVznD9QIE00PA== X-Received: by 10.28.56.196 with SMTP id f187mr3203114wma.120.1474561691962; Thu, 22 Sep 2016 09:28:11 -0700 (PDT) Received: from gourin.bzh.lan (ns304657.ip-46-105-103.eu. [46.105.103.66]) by smtp.gmail.com with ESMTPSA id n131sm38563165wmd.3.2016.09.22.09.28.10 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 22 Sep 2016 09:28:10 -0700 (PDT) From: "Yann E. MORIN" To: buildroot@buildroot.org Date: Thu, 22 Sep 2016 18:28:06 +0200 Message-Id: <1474561686-22804-1-git-send-email-yann.morin.1998@free.fr> X-Mailer: git-send-email 2.7.4 Cc: Thomas Petazzoni , "Yann E. MORIN" Subject: [Buildroot] [PATCH] package/linux-tools: don; t register each tools twice X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" Because each tool's individual .mk files are included from the top-level Makefile and we also include them from linux-tools.mk, they get registered twice, and thus built twice, and thus installed twice. We did included them from linux-tools.mk to guarantee they would be included early and each tool had a chance to register itself before we were to construct the build and install hooks. However, the ordering is _currently_ guaranteed, in the C locale by the files names, which we anyway sort using make's $(sort) function, which always sorts in the C locale. Beware if we are to ever rename thos files in the future... Signed-off-by: "Yann E. MORIN" Cc: Thomas Petazzoni --- package/linux-tools/linux-tools.mk | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/package/linux-tools/linux-tools.mk b/package/linux-tools/linux-tools.mk index dada172..1239111 100644 --- a/package/linux-tools/linux-tools.mk +++ b/package/linux-tools/linux-tools.mk @@ -10,6 +10,16 @@ # # So, all tools refer to $(LINUX_DIR) instead of $(@D). +# Note: we need individual tools .mk files to be included *before* this one +# 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 files: +# - 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 local e so that each tool's +# .mk file is included before this one. + # We only need the kernel to be extracted, not actually built LINUX_TOOLS_PATCH_DEPENDENCIES = linux @@ -17,18 +27,6 @@ LINUX_TOOLS_PATCH_DEPENDENCIES = linux # may install shared libraries and headers (e.g. cpupower). LINUX_TOOLS_INSTALL_STAGING = YES -# Include all our tools definitions. -# -# Note: our package infrastructure uses the full-path of the last-scanned -# Makefile to determine what package we're currently defining, using the -# last directory component in the path. As such, including other Makefile, -# like below, before we call one of the *-package macro is usally not -# working. -# However, since the files we include here are in the same directory as -# the current Makefile, we are OK. But this is a hard requirement: files -# included here *must* be in the same directory! -include $(sort $(wildcard package/linux-tools/linux-tool-*.mk)) - LINUX_TOOLS_DEPENDENCIES += $(foreach tool,$(LINUX_TOOLS),\ $(if $(BR2_PACKAGE_LINUX_TOOLS_$(call UPPERCASE,$(tool))),\ $($(call UPPERCASE,$(tool))_DEPENDENCIES)))