From patchwork Sat Jul 20 16:27:38 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 169306 Delivered-To: patch@linaro.org Received: by 2002:a92:4782:0:0:0:0:0 with SMTP id e2csp5290819ilk; Sat, 20 Jul 2019 09:27:58 -0700 (PDT) X-Google-Smtp-Source: APXvYqwldPpbHYycoKW+cqtYh8GWj95x12oSTl/hTBGap+z0hW7mtn4UZ4Bzgu8SvA+33UWxug1U X-Received: by 2002:a17:90a:3544:: with SMTP id q62mr65662782pjb.53.1563640078196; Sat, 20 Jul 2019 09:27:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563640078; cv=none; d=google.com; s=arc-20160816; b=o5b7uSU5lTlVikTtOwQL5B7PrhAR+n+jgdh2WGn7fByvjUQw76kPLyve8Ynk+3nQ3R VikcQUzV+6ZXMjXHwxYp1v0Gc/j/twiKo5Jtd+gptAcK0TagR02ny7NgV5JxOqyT5RN5 FQ96sQ5Sdk2DG0rZO+UAh+kbYffVom9LW1ClA6FBXIoPk9qfWHxTdm0fWG2vQlA9Wx1h PCqlr3zARnaskg8/fvgmJU535PuBNH4r7zkMQd2rOz1Mn4vdC8cvUld1mwSAMc1KDj7F PIa0U/3hDEAeQqUO/dvdN2ja7UaJjw9fhRTjMMgWMKp9MTGAIfMxMWn/Me3bw6A8+w0R yQDg== 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:dkim-filter; bh=Pv01/fNbqPnaUNjJtQ/RzZ1+tcdYQt0y1A77DCr4Efg=; b=wtNkmdgownfG4L2E59G6nEBFlqOUcUzFfOH4En1xCPmGdJxqEnQg+bVdivCkJQ2uln OhgEDKQvWB84QfZ+2vBbU9+U1IPEvifuSMiAtkX6CzTaT0YNhvhU7qaODVVtWx99Eexi Zkk5EdN+FajDq2/vshe/7taNZ3Kmam58FHHRrVVMro+iXu3bQrhF73KaLfknNq8XFMav UShR3MOhGCNUe1Ji/D82LusbceFE8h8Pw98+bKP1EImoW12D+jouzFKOCi+8FXGRkaKR R2TcKlrbo38jEehtfkkoNfS1R0jEepge+56L8KT6Qakkvg8w7AGY6Jm60TmtoCRCUsri nMVg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=Bb3pmzAp; 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.57; Sat, 20 Jul 2019 09:27:58 -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=Bb3pmzAp; 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 S1726580AbfGTQ1t (ORCPT + 29 others); Sat, 20 Jul 2019 12:27:49 -0400 Received: from conuserg-09.nifty.com ([210.131.2.76]:52417 "EHLO conuserg-09.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725940AbfGTQ1t (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 x6KGRfOq009136; Sun, 21 Jul 2019 01:27:41 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-09.nifty.com x6KGRfOq009136 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1563640061; bh=Pv01/fNbqPnaUNjJtQ/RzZ1+tcdYQt0y1A77DCr4Efg=; h=From:To:Cc:Subject:Date:From; b=Bb3pmzApRABgiJM6+BQoQfdOqInJvXbY2nUhOGGf80+w1n3V8GvycdsgBsCJ2rA5f BIZLEs0k6vBzgmSClr5B2DcHnVrkpjY/O7YhC5xbZTU08VR9dtScAZs0gfm7/xXf27 Kyucvr14YgPM/UexqQDxTw2mwDUDciMWZ9/t4qeiNeAdJXvQNk2A2vkP/WdKbC3Nm2 pHoA6vknaX/ZrJalZ4docIWfo7zybpIyZ9+LMUpk4mSF5Vx0tlzu6jEls9Sd9XS8Ni 0KTmLMBtwffVrhp9X5DkmduWtOYxzxaWpOJndpSo2gNvIHYCZLvUpUF8VoF7iZF2Bo yEQOteW+PPNhQ== 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 1/3] kbuild: use $(basename ...) for cmd_asn1_compiler Date: Sun, 21 Jul 2019 01:27:38 +0900 Message-Id: <20190720162740.4292-1-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.17.1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org $(basename ...) trims the last suffix. Using it is more intuitive in my opinion. This pattern rule makes %.asn1.c and %.asn1.h at the same time. Previously, the short log showed only either of them, depending on the target file in question. To clarify that two files are being generated by the single recipe, I changed the log as follows: Before: ASN.1 crypto/asymmetric_keys/x509.asn1.c After: ASN.1 crypto/asymmetric_keys/x509.asn1.[ch] Signed-off-by: Masahiro Yamada --- scripts/Makefile.build | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) -- 2.17.1 diff --git a/scripts/Makefile.build b/scripts/Makefile.build index 644431140434..7f71dbd180cb 100644 --- a/scripts/Makefile.build +++ b/scripts/Makefile.build @@ -388,9 +388,9 @@ $(obj)/%.lds: $(src)/%.lds.S FORCE # ASN.1 grammar # --------------------------------------------------------------------------- -quiet_cmd_asn1_compiler = ASN.1 $@ +quiet_cmd_asn1_compiler = ASN.1 $(basename $@).[ch] cmd_asn1_compiler = $(objtree)/scripts/asn1_compiler $< \ - $(subst .h,.c,$@) $(subst .c,.h,$@) + $(basename $@).c $(basename $@).h $(obj)/%.asn1.c $(obj)/%.asn1.h: $(src)/%.asn1 $(objtree)/scripts/asn1_compiler $(call cmd,asn1_compiler) From patchwork Sat Jul 20 16:27:39 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 169305 Delivered-To: patch@linaro.org Received: by 2002:a92:4782:0:0:0:0:0 with SMTP id e2csp5290813ilk; Sat, 20 Jul 2019 09:27:57 -0700 (PDT) X-Google-Smtp-Source: APXvYqwje+2q1OcFdQhsvWY67GSWQqPT24ZXa3GExCrbrAPNwmekQAtUT6OEIU20Q8TYhgsDidz6 X-Received: by 2002:a63:3805:: with SMTP id f5mr27908139pga.272.1563640077715; 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=aQDhZL/MkxAYvmo+9mPj/y+9U0T7GdLDOyHPERyNd6OzE6zGbs43H2WnJ14Xjq4Q9k +wsjt1s1ooY+9GqF5byTbJVplafOiNtFyZwzrIw4N0npUbXm5GsozSRTERKXtJoRfUy4 5YKgAr9kBjncXgE+OrnJlRWIlnUOOwjOfRa//6d3Hz9B0pAe91LexTBHjRz6C3hLTubr J9F/Qbezr6ujzRKWp56CpkFUXV9XwzrdZvt0qOqCyuQRHzps65fyRyHGhYkz/NhgxOIU N5XhjSrEBgdWuMyhZlFj7A5iEB0XMIvVRhMrf5YefbLpIfpGpzHc4ibXOkMR1Mh7i4XG UjNQ== 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=YWYhkhyNQMCU9Geqh6mdxj3ov/tBxwsPizahvUIX/a0=; b=cENo+2Ny83LtZE+u5+SuzPpeU0+LOsLgpKZG3tDwzWXCevDxcYyh/GEsUvZBpnMC35 U00rW3vn9mxAxBAbrv4U5eNZ0P4zU32TI201+flST7dIR3EMOmvuttlsoHx6eF+G6Yv5 D+sfYsITKB2J1/LgG5cikJ7SAS2W7QXTPW1k4+0QdvvoXsOKplxT/gCl8EnsmUnXQtUP Yep8UR4H7fOkdsH8g55qCS2z2LdKxtmXjiFbKNek8SNAgt/X7lW863hfGVAgwT0LglGG Q0WoAnkxMbF4qPV7CIutYxIRJQdk2P0TiE0FoyracLV5umM71IpxQJGgrgaEMU1hiWlw xH9A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=BEEnwqfb; 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.57; 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=BEEnwqfb; 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 S1726651AbfGTQ1v (ORCPT + 29 others); Sat, 20 Jul 2019 12:27:51 -0400 Received: from conuserg-09.nifty.com ([210.131.2.76]:52415 "EHLO conuserg-09.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726137AbfGTQ1u (ORCPT ); Sat, 20 Jul 2019 12:27:50 -0400 Received: from grover.flets-west.jp (softbank126026094249.bbtec.net [126.26.94.249]) (authenticated) by conuserg-09.nifty.com with ESMTP id x6KGRfOr009136; Sun, 21 Jul 2019 01:27:42 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-09.nifty.com x6KGRfOr009136 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1563640062; bh=YWYhkhyNQMCU9Geqh6mdxj3ov/tBxwsPizahvUIX/a0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=BEEnwqfbXR19pOuh8SGXJnppQecZhxjLGO7rcueaPNBJMBeHmFhXoV2yuVP5nSa3F rhRmz/hTIAG7AacdWnf5hnkBuuvHsSJ3Je8hdQ9+nYsAbC9TdHtIYt7iNbqaGCdjuw nIZrRjFbpOheuDQeWBJ/tqq9dVnKmm8UGdgH9ONM3KhK4RaXZcRk+ny39u8xnloylD 5PQJxrykWKviZioQq32/JNXDM5vgZV1wTifngvAe3BIrLQmh5/aeVyd2qoNAS2jPuc tmAU1qDvakt0y1OQ9DmomwmywpeOdnRgajPxo7S0enjqmHSUvBssY4GOEDKvmMVN+8 GllZ+WwU8+BYg== 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 2/3] kbuild: make bison create C file and header in a single pattern rule Date: Sun, 21 Jul 2019 01:27:39 +0900 Message-Id: <20190720162740.4292-2-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 We generally expect bison to create not only a C file, but also a header, which will be included from the lexer. Currently, Kbuild generates them in separate rules. So, for instance, when building Kconfig, you will notice bison is invoked twice: HOSTCC scripts/kconfig/conf.o HOSTCC scripts/kconfig/confdata.o HOSTCC scripts/kconfig/expr.o LEX scripts/kconfig/lexer.lex.c YACC scripts/kconfig/parser.tab.h HOSTCC scripts/kconfig/lexer.lex.o YACC scripts/kconfig/parser.tab.c HOSTCC scripts/kconfig/parser.tab.o HOSTCC scripts/kconfig/preprocess.o HOSTCC scripts/kconfig/symbol.o HOSTLD scripts/kconfig/conf Make handles such cases nicely in pattern rules [1]. Merge the two rules so that one invokcation of bison can generate both of them. HOSTCC scripts/kconfig/conf.o HOSTCC scripts/kconfig/confdata.o HOSTCC scripts/kconfig/expr.o LEX scripts/kconfig/lexer.lex.c YACC scripts/kconfig/parser.tab.[ch] HOSTCC scripts/kconfig/lexer.lex.o HOSTCC scripts/kconfig/parser.tab.o HOSTCC scripts/kconfig/preprocess.o HOSTCC scripts/kconfig/symbol.o HOSTLD scripts/kconfig/conf [1] Pattern rule GNU Make manual says: "Pattern rules may have more than one target. Unlike normal rules, this does not act as many different rules with the same prerequisites and recipe. If a pattern rule has multiple targets, make knows that the rule's recipe is responsible for making all of the targets. The recipe is executed only once to make all the targets. When searching for a pattern rule to match a target, the target patterns of a rule other than the one that matches the target in need of a rule are incidental: make worries only about giving a recipe and prerequisites to the file presently in question. However, when this file's recipe is run, the other targets are marked as having been updated themselves." https://www.gnu.org/software/make/manual/html_node/Pattern-Intro.html Signed-off-by: Masahiro Yamada --- scripts/Makefile.lib | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) -- 2.17.1 diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib index 8625e9b4572c..6c4a2332f6d6 100644 --- a/scripts/Makefile.lib +++ b/scripts/Makefile.lib @@ -199,18 +199,12 @@ $(obj)/%.lex.c: $(src)/%.l FORCE # YACC # --------------------------------------------------------------------------- -quiet_cmd_bison = YACC $@ - cmd_bison = $(YACC) -o$@ -t -l $< +quiet_cmd_bison = YACC $(basename $@).[ch] + cmd_bison = $(YACC) -o $(basename $@).c --defines=$(basename $@).h -t -l $< -$(obj)/%.tab.c: $(src)/%.y FORCE +$(obj)/%.tab.c $(obj)/%.tab.h: $(src)/%.y FORCE $(call if_changed,bison) -quiet_cmd_bison_h = YACC $@ - cmd_bison_h = $(YACC) -o/dev/null --defines=$@ -t -l $< - -$(obj)/%.tab.h: $(src)/%.y FORCE - $(call if_changed,bison_h) - # Shipped files # =========================================================================== 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 # ===========================================================================