From patchwork Tue Jun 7 04:34:43 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Chen X-Patchwork-Id: 69465 Delivered-To: patch@linaro.org Received: by 10.140.106.246 with SMTP id e109csp1790042qgf; Mon, 6 Jun 2016 21:36:45 -0700 (PDT) X-Received: by 10.31.134.1 with SMTP id i1mr8153588vkd.27.1465274205394; Mon, 06 Jun 2016 21:36:45 -0700 (PDT) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org. [192.237.175.120]) by mx.google.com with ESMTPS id p41si6715831uap.42.2016.06.06.21.36.45 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 06 Jun 2016 21:36:45 -0700 (PDT) Received-SPF: neutral (google.com: 192.237.175.120 is neither permitted nor denied by best guess record for domain of xen-devel-bounces@lists.xen.org) client-ip=192.237.175.120; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org; spf=neutral (google.com: 192.237.175.120 is neither permitted nor denied by best guess record for domain of xen-devel-bounces@lists.xen.org) smtp.mailfrom=xen-devel-bounces@lists.xen.org; dmarc=fail (p=NONE dis=NONE) header.from=linaro.org Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bA8j7-0003tt-P9; Tue, 07 Jun 2016 04:34:53 +0000 Received: from mail6.bemta14.messagelabs.com ([193.109.254.103]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bA8j5-0003tn-Mg for xen-devel@lists.xen.org; Tue, 07 Jun 2016 04:34:51 +0000 Received: from [193.109.254.147] by server-8.bemta-14.messagelabs.com id 22/AA-08354-AEE46575; Tue, 07 Jun 2016 04:34:50 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFprNIsWRWlGSWpSXmKPExsVyMfSOnu4rv7B wgwUnBSyWfFzM4sDocXT3b6YAxijWzLyk/IoE1ozZD04xFTzlrfj4dxF7A+MB7i5GLg4hgYmM EvN6G9hBHBaBdmaJlk3vmUEcCYF3LBJPVnUzdjFyAjkxEltvdUDZNRIXnjwEsjmA2pUkOiZUQ Ez6zShxv2ElWA2bgIrE9zf9rBD1ZhLnT85kArFFBKQlrn2+zAjSwCywnVHiYdtrFpCEsICTxI 7508AaWARUJfZ1/mQDsXkFzCXuLZnKDjFISeLVlWMsExj5FzAyrGLUKE4tKkst0jU01Usqykz PKMlNzMzRNTQ00ctNLS5OTE/NSUwq1kvOz93ECAyiegYGxh2Mf097HmKU5GBSEuV96B0WLsSX lJ9SmZFYnBFfVJqTWnyIUYaDQ0mCN8UXKCdYlJqeWpGWmQMMZ5i0BAePkgjvE5A0b3FBYm5xZ jpE6hSjMceW39fWMnFsm3pvLZMQS15+XqqUOO9BkFIBkNKM0jy4QbA4u8QoKyXMy8jAwCDEU5 BalJtZgir/ilGcg1FJmPcoyBSezLwSuH2vgE5hAjpl2bVgkFNKEhFSUg2MT29++c43y7bjkeT v7Qd5xGPOhLHkabzuYls6d10M/5qPj1aaqd3eH3lUyXzzfB8O5iOrGCbYTc/Y9Uar6FDpdDtZ rdC/lfu+usnkPpnsI/lzDW/QtU3fIky2Luv4fz9Y8sy97vs2gXcvbZzN5CAhxv7kk6kcv5CaX cRDppeCVr7OD3ctTm7iVmIpzkg01GIuKk4EAFSRtOSuAgAA X-Env-Sender: wei.chen@linaro.org X-Msg-Ref: server-15.tower-27.messagelabs.com!1465274088!46172526!1 X-Originating-IP: [209.85.220.46] X-SpamReason: No, hits=0.0 required=7.0 tests= X-StarScan-Received: X-StarScan-Version: 8.46; banners=-,-,- X-VirusChecked: Checked Received: (qmail 36310 invoked from network); 7 Jun 2016 04:34:49 -0000 Received: from mail-pa0-f46.google.com (HELO mail-pa0-f46.google.com) (209.85.220.46) by server-15.tower-27.messagelabs.com with AES128-GCM-SHA256 encrypted SMTP; 7 Jun 2016 04:34:49 -0000 Received: by mail-pa0-f46.google.com with SMTP id bz2so42011409pad.1 for ; Mon, 06 Jun 2016 21:34:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=t8GfoU5J+8G6rMOfc2QxV+If/XDXE9OYaLw2G/4h6EA=; b=gwKWIKk8Zg/zxLeRJ5FVlOkEAKObYMwgNtOEkr+iLh3amw1Zxnjivet3v4audrZRFQ bX6yYuh9l7RQ3g3LPt2iNfHB0UHERyMe9O8xCYmzGqs2tB9lsvl1+3l4p2hNnOEtAj3X N616tNnHhGWQwKrDJUIcDnjJIUG6Z46WuYp1Q= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=t8GfoU5J+8G6rMOfc2QxV+If/XDXE9OYaLw2G/4h6EA=; b=OO/xIWm/o002xuE2XOJ3iliIoBjWSDxdH7ORW+vdsJ8WTbhucWfY1YV02Ma0oG5Nrd NAjoeaYAepcZs6JLDV3j8g6ABtnhPRZwXUVBqmX7maCZsFQgQcbHnMpIQ5FW+XqvF0Sa Edhwtj4QCiGsq9MK/4/wsqEf3ZGPQhsHp8T0FJfmpCs0kBozZhPyoNKYQ6FwUJ58vmDJ sEDvr4KsLdra/P+xv5mMYgTVsUFyVNHZ9x0zRP7hGmvggnjoUx+FikxObLslk5QMSQJV 9IRIxCLq8y9fhHpYAe/FSkVLZTH2Gt6kPDXOWDddcmTtb/d+zR6PwffXGgmfrD4eWIvF nexg== X-Gm-Message-State: ALyK8tLDYNPfYMNq1uPYzLC8ioo8qB33uEhRktN2Jf7Eo+x9LthIpCt+ElA8U4/h7hAuYUSU X-Received: by 10.66.237.175 with SMTP id vd15mr28488918pac.139.1465274088380; Mon, 06 Jun 2016 21:34:48 -0700 (PDT) Received: from localhost.members.linode.com ([2400:8900::f03c:91ff:fe56:1324]) by smtp.gmail.com with ESMTPSA id f187sm31203613pfb.60.2016.06.06.21.34.46 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 06 Jun 2016 21:34:47 -0700 (PDT) From: Wei Chen X-Google-Original-From: Wei Chen To: xen-devel@lists.xen.org Date: Tue, 7 Jun 2016 12:34:43 +0800 Message-Id: <20160607043443.3111-1-Wei.Chen@linaro.org> X-Mailer: git-send-email 2.9.0.rc0 Cc: sstabellini@kernel.org, wei.liu2@citrix.com, steve.capper@arm.com, andrew.cooper3@citrix.com, ian.jackson@eu.citrix.com, julien.grall@arm.com, Wei Chen Subject: [Xen-devel] [RFC v2] xen/arm: build: add missed dependency for head.S X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" In current Xen build rules, the build system will only check the dependencies in current folder and obj-y generated dependencies in other folder. But Makefile may add some objects to ALL_OBJS. These objects may be not in the same folder as Makefile. Use arch/arm/Makefile as an example: ALL_OBJS := $(TARGET_SUBARCH)/head.o The head.o is not in the same folder as Makefile and is not listed in obj-y. So, when we update the header files that had been included in head.S. The build system would not check the dependency of head.S. The head.S would not be re-compiled. In this patch, we will get objects added by Makefile and add their dependencies to check list. Signed-off-by: Wei Chen --- v1 -> v2: - Use a generic method instead of changing Makefiles --- xen/Rules.mk | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/xen/Rules.mk b/xen/Rules.mk index 961d533..fb3087c 100644 --- a/xen/Rules.mk +++ b/xen/Rules.mk @@ -95,12 +95,21 @@ include $(BASEDIR)/arch/$(TARGET_ARCH)/Rules.mk include Makefile DEPS = .*.d + +# In obj-y and ALL_OBJS, there may have some objects are not in the +# same folder as Makefile, so we have to use gendep to generate +# dependencies for them. +DEP_OBJS = $(obj-y) + +# Extract objects from ALL_OBJS added by Makefile. +DEP_OBJS += $(filter-out %built_in.o,$(ALL_OBJS)) + define gendep ifneq ($(1),$(subst /,:,$(1))) DEPS += $(dir $(1)).$(notdir $(1)).d endif endef -$(foreach o,$(filter-out %/,$(obj-y)),$(eval $(call gendep,$(o)))) +$(foreach o,$(filter-out %/,$(DEP_OBJS)),$(eval $(call gendep,$(o)))) # Ensure each subdirectory has exactly one trailing slash. subdir-n := $(patsubst %,%/,$(patsubst %/,%,$(subdir-n) $(subdir-)))