From patchwork Sun Jun 30 09:09:28 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: zzs0213@gmail.com X-Patchwork-Id: 2804321 Return-Path: X-Original-To: patchwork-linux-kbuild@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 244B6BF4A1 for ; Sun, 30 Jun 2013 09:11:14 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 26C8F20107 for ; Sun, 30 Jun 2013 09:11:13 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 85543200F7 for ; Sun, 30 Jun 2013 09:11:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751652Ab3F3JKn (ORCPT ); Sun, 30 Jun 2013 05:10:43 -0400 Received: from mail-pb0-f54.google.com ([209.85.160.54]:53480 "EHLO mail-pb0-f54.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750976Ab3F3JKm (ORCPT ); Sun, 30 Jun 2013 05:10:42 -0400 Received: by mail-pb0-f54.google.com with SMTP id ro2so3779191pbb.27 for ; Sun, 30 Jun 2013 02:10:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references; bh=XHVfDkbbo/ufQJTFzk/mRRaYoQdBxKgPaHhIDDDGowE=; b=QkWawds/FPJJIethVFEs5TCOh2z4/IuLgwTZbGkoWFq360SVv7MKrd82VdOT3oEkcR 1lNgvrAnnflZ94wCpq2OOVGdCXAkB/gZtzg60xDdq9tcVNcurozwygPkB5abf0j2a7XQ KnQIiLDVqDpGjJBQ8j6dz92EQABz+M0zp2a/v+Q5tcEn5axHwVc4peJRav5kESNNdcv2 2rTYoMvtEByDF0YSRSqCi5ew5kCD3s4lRuCnu/DwPAxlCZTKpt6DwgezHKIduIU7VGEy uGKGH20QIq+e3CU+EvAhjjaE7IwozpJQYDJJc7uv6QBcvDDHaJ/Xt5/4uFOMVCgz3ogl BrYg== X-Received: by 10.68.239.66 with SMTP id vq2mr18943943pbc.182.1372583442158; Sun, 30 Jun 2013 02:10:42 -0700 (PDT) Received: from localhost.localdomain ([171.214.236.144]) by mx.google.com with ESMTPSA id qe10sm16596289pbb.2.2013.06.30.02.10.38 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sun, 30 Jun 2013 02:10:41 -0700 (PDT) From: =?UTF-8?q?=E5=BC=A0=E5=BF=A0=E5=B1=B1?= To: Cc: , , =?UTF-8?q?=E5=BC=A0=E5=BF=A0=E5=B1=B1?= Subject: [PATCH] let kbuild mkdir for dir/file.o Date: Sun, 30 Jun 2013 17:09:28 +0800 Message-Id: <1372583368-32618-1-git-send-email-zzs0213@gmail.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <51CE11C2.5020406@suse.cz> References: <51CE11C2.5020406@suse.cz> Sender: linux-kbuild-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kbuild@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP When add a obj with dir to obj-y, like this obj-y += dir/file.o The $(obj)/dir not created, this patch fix this. When try to add a file(which in a subdir) to my board's obj-y, the build progress crashed. For example, I use at91rm9200ek board, and in kernel dir run: mkdir objtree make O=objtree at91rm9200_defconfig mkdir arch/arm/mach-at91/dir touch arch/arm/mach-at91/dir/file.c and edit arch/arm/mach-at91/dir/file.c to add some code. then edit arch/arm/mach-at91/Makefile, change the following line: obj-$(CONFIG_MACH_AT91RM9200EK) += board-rm9200ek.o to: obj-$(CONFIG_MACH_AT91RM9200EK) += board-rm9200ek.o dir/file.o Now build it: make O=objtree Then the error appears: ... CC arch/arm/mach-at91/board-rm9200dk.o CC arch/arm/mach-at91/board-rm9200ek.o CC arch/arm/mach-at91/dir/file.o linux-2.6/arch/arm/mach-at91/dir/file.c:5: fatal error: opening dependency file arch/arm/mach-at91/dir/.file.o.d: No such file or directory Check the objtree: LANG=en ls objtree/arch/arm/mach-at91/dir ls: cannot access objtree/arch/arm/mach-at91/dir: No such file or directory It's apparently that the target dir not created for file.o Check kbuild source code. It seems that kbuild create dirs for that in $(obj-dirs). But if the dir need not to create a built-in.o, It should never in $(obj-dirs). So I make this patch to make sure It in $(obj-dirs) this bug caused by commit f5fb976520a53f45f8bbf2e851f16b3b5558d485 --- scripts/Makefile.lib | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib index 51bb3de..cddd2c9 100644 --- a/scripts/Makefile.lib +++ b/scripts/Makefile.lib @@ -63,7 +63,7 @@ multi-objs := $(multi-objs-y) $(multi-objs-m) subdir-obj-y := $(filter %/built-in.o, $(obj-y)) # $(obj-dirs) is a list of directories that contain object files -obj-dirs := $(dir $(multi-objs) $(subdir-obj-y)) +obj-dirs := $(dir $(multi-objs) $(obj-y)) # Replace multi-part objects by their individual parts, look at local dir only real-objs-y := $(foreach m, $(filter-out $(subdir-obj-y), $(obj-y)), $(if $(strip $($(m:.o=-objs)) $($(m:.o=-y))),$($(m:.o=-objs)) $($(m:.o=-y)),$(m))) $(extra-y)