From patchwork Sat Jul 20 16:27:40 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 169304 Delivered-To: patch@linaro.org Received: by 2002:a92:4782:0:0:0:0:0 with SMTP id e2csp5290800ilk; Sat, 20 Jul 2019 09:27:57 -0700 (PDT) X-Google-Smtp-Source: APXvYqwWoRD1iD1Vefwb+y8bPE3ntHfHjK5la2Xy1ZEgQwrHpD/5wfLSk9VHw4AxsEhzEd6NBErB X-Received: by 2002:a17:902:2aab:: with SMTP id j40mr13876291plb.76.1563640077104; Sat, 20 Jul 2019 09:27:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563640077; cv=none; d=google.com; s=arc-20160816; b=WV08GI/h9QWkahvi+xr2i99OfTYo/krDCi3HGkaR2QBsj1e8vh9BN3fd2Nsfh3C/YW /DbdWRNzPcEQPOarlEOqNGtpvgtl0rLZxZy3bstlRb387Uk0x7F/bac5VALFwipOMB/X XDxyldfCgTTajv8pC6cZWLfrBM81ye+XksiTaiy/U70D+MUCMVZL0k8NIvKIKUgRdNPW vHXOhPDCPN37/qUKuOKCCN1mZUwK5lHnVzfoYkHYv4A/D4PksQCGtgsuTVwiRMQ6ie1I k+cdIVe5SY3mEcuB5OoL7HoMh/OZY4BA9rXTe0sMLslBushSKUVh5Tz1FxEiC4LLYkUC 3VoQ== 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; bh=uYu3VJ6J2qsvZ4CUEzwqQcj7TCaHdD1WcbA0oBYilBg=; b=0ylkiS/LBqncLuxEEumhnRWzca5S7TQUTSvYOTVjNUlYjVBwNs5T7oUUJC3zsNx8L6 53iXA4lAnBshyTt8NTRZBv9rHMhQXLJhP9iSYYYViskMWoEqH5aadatm7ext95l+i4Nl fC1vVSMOlM3o94+N6ipvLQtHHl/8vWdXjLubalL1+VCs2rc4K9dyX+MXw032pkJ2N9Rc qkOdIL4CtyyZ9tm0DPoWAskQNd/4YjrYIpmJ13asyDGfqKRMsmBlw9fqZIuIVa0L6FlC 30TDT05coWTrwSHNOVhW/hkxqeWpo772gStC6ubOs3ypWDd5hG5kEUDpp+N/+5Aa62P2 gqWw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=NxOBzB80; 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 j9si2917262pgh.159.2019.07.20.09.27.56; Sat, 20 Jul 2019 09:27:57 -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=NxOBzB80; 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 S1726616AbfGTQ1u (ORCPT + 29 others); Sat, 20 Jul 2019 12:27:50 -0400 Received: from conuserg-09.nifty.com ([210.131.2.76]:52416 "EHLO conuserg-09.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726167AbfGTQ1t (ORCPT ); Sat, 20 Jul 2019 12:27:49 -0400 Received: from grover.flets-west.jp (softbank126026094249.bbtec.net [126.26.94.249]) (authenticated) by conuserg-09.nifty.com with ESMTP id x6KGRfOs009136; Sun, 21 Jul 2019 01:27:42 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-09.nifty.com x6KGRfOs009136 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1563640062; bh=uYu3VJ6J2qsvZ4CUEzwqQcj7TCaHdD1WcbA0oBYilBg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=NxOBzB80zpfhtzZD/sLrD6crVhdzRlsP4w2a7u7fLE+4u69dS+fqmHrNbIxlZZUME DwU0fFzTBzfExAmdmrAaHYp21mp4BUHeH/II+JAi0ZvhvKht6sQj1lE5vaviFAlfil 9j7VO1OK//S5aKiHZfXW5pl8aPvlkD8t0DlQdcQrRGCMDoSWbN1DH9UdahBM97Vx/P xumd4gOBfD8R+KA7oYMUUKWVMBnNeyYmm5JLDawPlB+TnO3R3z9WsIVZQYR0KQfTcA C2S/29a5Mn9JIdgle60b3CHDWwYlxTztzn/JWlq+9YlLmg1VEhh0KtyNYEBZKhEY8e zS5Rc1edLE/hQ== X-Nifty-SrcIP: [126.26.94.249] From: Masahiro Yamada To: linux-kbuild@vger.kernel.org Cc: Masahiro Yamada , Michal Marek , linux-kernel@vger.kernel.org Subject: [PATCH 3/3] kbuild: move flex and bison rules to Makefile.host Date: Sun, 21 Jul 2019 01:27:40 +0900 Message-Id: <20190720162740.4292-3-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190720162740.4292-1-yamada.masahiro@socionext.com> References: <20190720162740.4292-1-yamada.masahiro@socionext.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Flex and bison are used for kconfig, dtc, genksyms, all of which are host programs. I never imagine the kernel embeds a parser or a lexer. Move the flex and bison rules to scripts/Makefile.host. This file is included only when hostprogs-y etc. is present in the Makefile in the directory. So, parsing these rules are skipped in most of directories. Signed-off-by: Masahiro Yamada --- scripts/Makefile.host | 17 +++++++++++++++++ scripts/Makefile.lib | 16 ---------------- 2 files changed, 17 insertions(+), 16 deletions(-) -- 2.17.1 diff --git a/scripts/Makefile.host b/scripts/Makefile.host index 2208ebbd8c4c..b402c619147d 100644 --- a/scripts/Makefile.host +++ b/scripts/Makefile.host @@ -1,4 +1,21 @@ # SPDX-License-Identifier: GPL-2.0 + +# LEX +# --------------------------------------------------------------------------- +quiet_cmd_flex = LEX $@ + cmd_flex = $(LEX) -o$@ -L $< + +$(obj)/%.lex.c: $(src)/%.l FORCE + $(call if_changed,flex) + +# YACC +# --------------------------------------------------------------------------- +quiet_cmd_bison = YACC $(basename $@).[ch] + cmd_bison = $(YACC) -o $(basename $@).c --defines=$(basename $@).h -t -l $< + +$(obj)/%.tab.c $(obj)/%.tab.h: $(src)/%.y FORCE + $(call if_changed,bison) + # ========================================================================== # Building binaries on the host system # Binaries are used during the compilation of the kernel, for example diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib index 6c4a2332f6d6..4d65172cdcd4 100644 --- a/scripts/Makefile.lib +++ b/scripts/Makefile.lib @@ -189,22 +189,6 @@ $(foreach m, $(notdir $1), \ $(addprefix $(obj)/, $(foreach s, $3, $($(m:%$(strip $2)=%$(s))))))) endef -# LEX -# --------------------------------------------------------------------------- -quiet_cmd_flex = LEX $@ - cmd_flex = $(LEX) -o$@ -L $< - -$(obj)/%.lex.c: $(src)/%.l FORCE - $(call if_changed,flex) - -# YACC -# --------------------------------------------------------------------------- -quiet_cmd_bison = YACC $(basename $@).[ch] - cmd_bison = $(YACC) -o $(basename $@).c --defines=$(basename $@).h -t -l $< - -$(obj)/%.tab.c $(obj)/%.tab.h: $(src)/%.y FORCE - $(call if_changed,bison) - # Shipped files # ===========================================================================