All of lore.kernel.org
 help / color / mirror / Atom feed
From: Arnaud Lacombe <lacombar@gmail.com>
To: linux-kbuild@vger.kernel.org
Cc: Michal Marek <mmarek@suse.cz>, Arnaud Lacombe <lacombar@gmail.com>
Subject: [RFC 0/9] Kbuild: factor parser rules
Date: Wed,  4 May 2011 22:03:15 -0400	[thread overview]
Message-ID: <1304561004-2684-1-git-send-email-lacombar@gmail.com> (raw)

Hi Folks,

I noticed recently that several program under scripts/ implement their own set
of gperf/lex/yacc rules. The following patchset aims at factoring all these
targets into `scripts/Makefiles.lib'. Patches do the job for `genksyms' and
`kconfig', `dtc' remains to be done.

I am not really happy with the file naming, in particular the lexer which breaks
convention. I would prefer something ala:
 - parser: %.tab.c
 - lexer: %.lex.c
 - hash: %.hash.c

Moreover, I'd prefer to build the lexer and parser as a different compilation
unit, but that might be done later on.

The following also allows to automatically regen the %_shipped file upon
modification of its associated prerequiresite, provided REGENERATE_PARSERS is
defined.

The diff may look mistakenly large as I had to shuffle things around to make
them match the same pattern.

Known issue: there should be 2 new warnings introduced in `genksyms', only
compile tested so far (only on tools, not on the full kernel), in particular,
`gperf' options may need to be tuned.

Patches are based on v2.6.38. Not for merge, so not signed off on purpose.

Comments welcome!
 - Arnaud

Arnaud Lacombe (9):
  genksyms: rename parser files
  genksyms: finalize rename
  genksyms: pass hash and lookup functions name and target language
    though the input file
  genksyms: regen parser
  kconfig: constify `kconf_id_lookup'
  kconfig: regen parsers
  kbuild: merge parser generation rules
  kconfig: regen parser
  genksyms: regen parser

 scripts/Makefile.lib                     |   31 +-
 scripts/genksyms/.gitignore              |    6 +-
 scripts/genksyms/Makefile                |   43 +-
 scripts/genksyms/genksyms.c              |   11 +-
 scripts/genksyms/genksyms.gperf          |   59 +
 scripts/genksyms/genksyms.hash.c_shipped |  220 +++
 scripts/genksyms/genksyms.l              |  408 +++++
 scripts/genksyms/genksyms.tab.c_shipped  | 2324 +++++++++++++++++++++++++
 scripts/genksyms/genksyms.y              |  475 ++++++
 scripts/genksyms/keywords.c_shipped      |  220 ---
 scripts/genksyms/keywords.gperf          |   56 -
 scripts/genksyms/lex.c_shipped           | 2709 ------------------------------
 scripts/genksyms/lex.genksyms.c_shipped  | 2242 ++++++++++++++++++++++++
 scripts/genksyms/lex.l                   |  409 -----
 scripts/genksyms/parse.c_shipped         | 2353 --------------------------
 scripts/genksyms/parse.h_shipped         |  139 --
 scripts/genksyms/parse.y                 |  473 ------
 scripts/kconfig/Makefile                 |   25 -
 scripts/kconfig/lex.zconf.c_shipped      |   26 +-
 scripts/kconfig/zconf.gperf              |    2 +-
 scripts/kconfig/zconf.hash.c_shipped     |  273 ++--
 scripts/kconfig/zconf.l                  |    4 +-
 scripts/kconfig/zconf.tab.c_shipped      |   32 +-
 scripts/kconfig/zconf.y                  |    8 +-
 24 files changed, 5959 insertions(+), 6589 deletions(-)
 create mode 100644 scripts/genksyms/genksyms.gperf
 create mode 100644 scripts/genksyms/genksyms.hash.c_shipped
 create mode 100644 scripts/genksyms/genksyms.l
 create mode 100644 scripts/genksyms/genksyms.tab.c_shipped
 create mode 100644 scripts/genksyms/genksyms.y
 delete mode 100644 scripts/genksyms/keywords.c_shipped
 delete mode 100644 scripts/genksyms/keywords.gperf
 delete mode 100644 scripts/genksyms/lex.c_shipped
 create mode 100644 scripts/genksyms/lex.genksyms.c_shipped
 delete mode 100644 scripts/genksyms/lex.l
 delete mode 100644 scripts/genksyms/parse.c_shipped
 delete mode 100644 scripts/genksyms/parse.h_shipped
 delete mode 100644 scripts/genksyms/parse.y

-- 
1.7.3.4.574.g608b.dirty


             reply	other threads:[~2011-05-05  2:03 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-05  2:03 Arnaud Lacombe [this message]
2011-05-05  2:03 ` [RFC 2/9] genksyms: finalize rename Arnaud Lacombe
2011-05-05  2:06   ` Arnaud Lacombe
2011-05-05 14:23   ` Michal Marek
2011-05-23  2:17     ` Arnaud Lacombe
2011-05-23  3:32       ` Arnaud Lacombe
2011-05-05  2:03 ` [RFC 3/9] genksyms: pass hash and lookup functions name and target language though the input file Arnaud Lacombe
2011-05-05  2:03 ` [RFC 4/9] genksyms: regen parser Arnaud Lacombe
2011-05-05  2:03 ` [RFC 5/9] kconfig: constify `kconf_id_lookup' Arnaud Lacombe
2011-05-05  2:03 ` [RFC 6/9] kconfig: regen parsers Arnaud Lacombe
2011-05-05  2:03 ` [RFC 7/9] kbuild: merge parser generation rules Arnaud Lacombe
2011-05-05 13:32   ` Michal Marek
2011-05-05 14:50     ` Arnaud Lacombe
2011-05-05  2:03 ` [RFC 8/9] kconfig: regen parser Arnaud Lacombe
2011-05-05  2:03 ` [RFC 9/9] genksyms: " Arnaud Lacombe
     [not found] ` <1304561004-2684-2-git-send-email-lacombar@gmail.com>
2011-05-05 14:18   ` [RFC 1/9] genksyms: rename parser files Michal Marek
2011-05-23  2:06     ` Arnaud Lacombe
2011-05-23  5:48       ` Arnaud Lacombe

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1304561004-2684-1-git-send-email-lacombar@gmail.com \
    --to=lacombar@gmail.com \
    --cc=linux-kbuild@vger.kernel.org \
    --cc=mmarek@suse.cz \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.