Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp2140765imm; Mon, 28 May 2018 02:26:17 -0700 (PDT) X-Google-Smtp-Source: AB8JxZruI2+LtUFumC8nlC4tJXJUBARPJW10dAfVHUhlq1evurw/23RduaVPicxH8dU9R6dNrbAu X-Received: by 2002:a63:91c8:: with SMTP id l191-v6mr10013582pge.53.1527499577159; Mon, 28 May 2018 02:26:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527499577; cv=none; d=google.com; s=arc-20160816; b=pFDKfwcCkya6mZ6Ghw9jrwfpoqVo9QfkypvYgTuMK2GU10JraEILN6u9TtKMStxRkg iHwmThvoGHaXNREUT0WSKlTs4u1X6iW4TmaPGzc+81lDsHYkFY5Sm/GdQnPrwFJVU8ee xQQqcIRvWYHkDv6Jxab0MNJKESpYtYoHzZE+nHiqqPK0olZrpfBYnpxq0lvVP1sTJNoX gKeQrd1bUV/Mh9iwasa+eCt93vq2BeIKeNUipqLKVUIcvAIYMpfRlrtIpaTOTTNS03xZ JqPZizNUJnjb1I4f+cDLnUquuedvLT+IGKMwE0+Kq2fIG2ZWUK3sbOjHyHXhcckin4mw 8PrA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:dkim-filter :arc-authentication-results; bh=lnlXgpG2yr3gcltd1Tfk1Ic+F5H37kq4DDC7fttMI+M=; b=PevLMx6BAaWvV37xiRF/teKYkowDKvn6m4Eal05akQvPGNe6junAcQ6tzUwlRHjHkr OjJO5Ul9Ts8EhrKmSPTbEFEY/3boRZndU96Vlo8BGu69TRpSDk/LV3NLA17pdmp/Mqbz gX69Fi+JytFnnNHn5bftNA7AdwBk8GdJDQPjLMsjRXmmUDyH749ekG5uEMd1Wg5X30Pi eWAfNH2l4lrSE4SFvq5XNv7VNGJsR2PzKT1eenMAtR7ln1chkItgB+Alo3nLlDtgyFQh EGR+3Tmck5hSv3Fua3iE5FadsCwaL3cy5egi6+mCfhig0ac2WQin0iBjmfwHYnmIBayL aKhg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=0SjgHlGG; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g2-v6si31922752plm.181.2018.05.28.02.26.02; Mon, 28 May 2018 02:26:17 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=0SjgHlGG; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933822AbeE1JZT (ORCPT + 99 others); Mon, 28 May 2018 05:25:19 -0400 Received: from conuserg-10.nifty.com ([210.131.2.77]:23165 "EHLO conuserg-10.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933652AbeE1JZJ (ORCPT ); Mon, 28 May 2018 05:25:09 -0400 Received: from grover.sesame (FL1-125-199-20-195.osk.mesh.ad.jp [125.199.20.195]) (authenticated) by conuserg-10.nifty.com with ESMTP id w4S9MInW027506; Mon, 28 May 2018 18:22:31 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-10.nifty.com w4S9MInW027506 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1527499352; bh=lnlXgpG2yr3gcltd1Tfk1Ic+F5H37kq4DDC7fttMI+M=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=0SjgHlGGUBYwbKzkRSQbUdD6UfsTXr7xFW07Vkc/xUCpFhiuiw0Y3DJ9X9QytQOyU Sb285tZtIeqBxaBgIICuaRZZbwT8+8caneCScsbYKUImfHAkrjHida3di3UVbs17So NvfhWzeIgxD+urnNnv2hTazWoei6jaoba9IUB2+INz6RFn76gFklZampIRNS85YYqy 9/t06cHo9MdtrACaZ7Ypr3I3k+OPaeLSP4ggS4wPkA9Qvm4r62/MTfQhosT5vwUZDe oCazBHuAqsEYGwa75hB/DbE8RK3sK5KdkeKKyTrR6WeBstoZKnxUWvj4RwPqx4Jact gkj4CkYzJ1GGw== X-Nifty-SrcIP: [125.199.20.195] From: Masahiro Yamada To: linux-kbuild@vger.kernel.org Cc: linux-kernel@vger.kernel.org, Kees Cook , Nicholas Piggin , "Luis R . Rodriguez" , Randy Dunlap , Ulf Magnusson , Sam Ravnborg , Linus Torvalds , Masahiro Yamada Subject: [PATCH v5 15/31] kconfig: expand lefthand side of assignment statement Date: Mon, 28 May 2018 18:21:52 +0900 Message-Id: <1527499328-13213-16-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1527499328-13213-1-git-send-email-yamada.masahiro@socionext.com> References: <1527499328-13213-1-git-send-email-yamada.masahiro@socionext.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Make expands the lefthand side of assignment statements. In fact, Kbuild relies on it since kernel makefiles mostly look like this: obj-$(CONFIG_FOO) += foo.o Do likewise in Kconfig. Signed-off-by: Masahiro Yamada --- Changes in v5: None Changes in v4: None Changes in v3: None Changes in v2: None scripts/kconfig/zconf.l | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/scripts/kconfig/zconf.l b/scripts/kconfig/zconf.l index a6cbe2d..25bd2b8 100644 --- a/scripts/kconfig/zconf.l +++ b/scripts/kconfig/zconf.l @@ -114,6 +114,13 @@ n [A-Za-z0-9_-] yylval.string = text; return T_VARIABLE; } + ({n}|$)+ { + /* this token includes at least one '$' */ + yylval.string = expand_token(yytext, yyleng); + if (strlen(yylval.string)) + return T_VARIABLE; + free(yylval.string); + } "=" { BEGIN(ASSIGN_VAL); yylval.flavor = VAR_RECURSIVE; return T_ASSIGN; } ":=" { BEGIN(ASSIGN_VAL); yylval.flavor = VAR_SIMPLE; return T_ASSIGN; } "+=" { BEGIN(ASSIGN_VAL); yylval.flavor = VAR_APPEND; return T_ASSIGN; } -- 2.7.4