Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp566834ybz; Fri, 24 Apr 2020 23:13:13 -0700 (PDT) X-Google-Smtp-Source: APiQypJI+/SwvTAwWV4n6K6dlXJ3/jVqXjKqBPNTTuA1ACUYwMzY1bvTv48pAmPRjXFnW6DkevjR X-Received: by 2002:a17:907:a89:: with SMTP id by9mr10170254ejc.289.1587795193183; Fri, 24 Apr 2020 23:13:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1587795193; cv=none; d=google.com; s=arc-20160816; b=kdi9FeiFPVQx46AMfyoEtd4IbNNpQJoBlQMbFkmEGE16UjaCt9Z6ObiB1WlB8n7tPS 8B4sU9GCPEPKYG32Svcn3EhOcSXuwBY1l+mQkGP+GSVypNLj26GqEFxJjYc3Y0HbRZbJ hs5jhuedF1JJx8RLNuyK264mmd6cerHsrXrBbt6P84N0aWgvrK6rPwk8326VZDKHyZIX ItNE81cLcT6FYynE3cYeoI315HSC3EGeVQ5ldGv7OrpcUqIvITYXJKi34Ia1epyVnjyu ss+yAJNJu0crZP3ymdr4LTCatbOeeGl1LGljRKtuogN2nUOXDbzB67ZDBhQ5PK7kClqn Mk8g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature; bh=+ESiA77ZEHDu9ZQN5XF7l7lfdmphsqNlyWqP3Q+iRdE=; b=NzfbVRTsqi5JRReuxbgmT181bjO6380pq4oswoyFAAlzhHViquTYwIC0yiESgpih/7 Y2ibfFrhi6yC46m0OYAQE96rM8pkNMZfaiu7ODoOnK86dmhTkXjPkt2Rt8EErAqPKxJk wgtUCNHjWWZCtQg1iAif8pYIcUD12m8uVo0Is74jDYcv41cypMZ+sMDIfiwndFHOX52c sn0rBYj2xrm8Mm4lXYvEBC5j0sXxw/jTxctUJglftZM1EklZp6/zjnQrzhemUO16JGoY TO2gIydE4W3leoAlwR0cDBZPA+u5HIyc/Q7Y9yA0tVI9npUPSgKKjwMwi0XYJpL99Jth 03DA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@163.com header.s=s110527 header.b="fGtT/DnZ"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=163.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a22si4821043edn.385.2020.04.24.23.12.44; Fri, 24 Apr 2020 23:13:13 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@163.com header.s=s110527 header.b="fGtT/DnZ"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=163.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726118AbgDYGJO (ORCPT + 99 others); Sat, 25 Apr 2020 02:09:14 -0400 Received: from m12-14.163.com ([220.181.12.14]:34093 "EHLO m12-14.163.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725837AbgDYGJO (ORCPT ); Sat, 25 Apr 2020 02:09:14 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=163.com; s=s110527; h=From:Subject:Date:Message-Id; bh=+ESiA77ZEHDu9ZQN5X F7l7lfdmphsqNlyWqP3Q+iRdE=; b=fGtT/DnZaiu7ifhpeD3+s1Ht14ilmtsCQN p8q7D0sGQ8Pd0lZW/EPkG7QgwEQmS6TFRvh1m0P9o/7VthAIK2fwDRR6hFcY93R4 QaNwsMncaR4YRuhWJR2zdIMGQABBWJ9sogtP+gCaLxFDmv68v8YFzg1XgvKS5r8E noPL8vW6U= Received: from localhost.localdomain (unknown [114.246.35.16]) by smtp10 (Coremail) with SMTP id DsCowABndWHo06NesaqMBw--.24886S2; Sat, 25 Apr 2020 14:08:53 +0800 (CST) From: Wang Nan To: wangnan0@huawei.com, Masahiro Yamada , Michal Marek Cc: linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org, Wang Nan Subject: [PATCH] kbuild: Add $(strip ...) before compare make variable with string Date: Sat, 25 Apr 2020 14:07:38 +0800 Message-Id: <1587794858-938-1-git-send-email-pi3orama@163.com> X-Mailer: git-send-email 2.7.4 X-CM-TRANSID: DsCowABndWHo06NesaqMBw--.24886S2 X-Coremail-Antispam: 1Uf129KBjvJXoWxJr17trW8KrWDKr4rtw48tFb_yoW8Ar1rpa 95Cws8JayrCFWkt3Z5AF48Kr1Fqw10v3yj9FWrJw1UAFnrta1xKF42krZ8Xa4xKFs3ArWU Wryak34rZr4kXaUanT9S1TB71UUUUU7qnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDUYxBIdaVFxhVjvjDU0xZFpf9x07Uk-BiUUUUU= X-Originating-IP: [114.246.35.16] X-CM-SenderInfo: lslt02xdpdqiywtou0bp/xtbBdQYRQFaD62ywBQADsG Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Some of ifneq in Makefile.build works improperly: ifneq ($(a)$(b)$(c),) ... endif Because some make vairable contains unintended spaces introduced by: a := $(x) $(y) This commit adds $(strip ...) to some potentially buggy ifneq. Signed-off-by: Wang Nan Cc: Masahiro Yamada Cc: Michal Marek --- scripts/Makefile.build | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/Makefile.build b/scripts/Makefile.build index 9fcbfac..b2bc0db 100644 --- a/scripts/Makefile.build +++ b/scripts/Makefile.build @@ -46,7 +46,7 @@ include $(kbuild-file) include scripts/Makefile.lib # Do not include host rules unless needed -ifneq ($(hostprogs)$(hostcxxlibs-y)$(hostcxxlibs-m),) +ifneq ($(strip $(hostprogs) $(hostcxxlibs-y) $(hostcxxlibs-m)),) include scripts/Makefile.host endif @@ -55,7 +55,7 @@ $(warning kbuild: Makefile.build is included improperly) endif ifeq ($(need-modorder),) -ifneq ($(obj-m),) +ifneq ($(strip $(obj-m)),) $(warning $(patsubst %.o,'%.ko',$(obj-m)) will not be built even though obj-m is specified.) $(warning You cannot use subdir-y/m to visit a module Makefile. Use obj-y/m instead.) endif @@ -512,7 +512,7 @@ obj-dirs := $(sort $(obj) $(patsubst %/,%, $(dir $(targets)))) # If targets exist, their directories apparently exist. Skip mkdir. existing-dirs := $(sort $(patsubst %/,%, $(dir $(existing-targets)))) obj-dirs := $(strip $(filter-out $(existing-dirs), $(obj-dirs))) -ifneq ($(obj-dirs),) +ifneq ($(strip $(obj-dirs)),) $(shell mkdir -p $(obj-dirs)) endif endif -- 2.7.4