Re: [PATCH v2 10/11] cmake: parse the makefile for the sources.
- From
Sibi Siddharthan <sibisiddharthan.github@gmail.com>
- Date
- May 13, 2020, 19:57 UTC
- Message-ID
- <CAKiG+9Uc8Kc1F3wN7AoLkBR8Uk1up5sZXpgUperhQO6NVmBRxw@mail.gmail.com>
- In-Reply-To
- <xmqqk11gc1d5.fsf@gitster.c.googlers.com>
On Wed, May 13, 2020 at 2:33 AM Junio C Hamano <gitster@pobox.com> wrote:
Show 26 quoted lines
> > "Sibi Siddharthan via GitGitGadget" <gitgitgadget@gmail.com> writes: > > > From: Sibi Siddharthan <sibisiddharthan.github@gmail.com> > > > > The CMake script parses the Makefile for: > > SCRIPT_SH > > SCRIPT_PERL > > TEST_BUILTINS_OBJS > > LIB_OBJS > > BUILTIN_OBJS > > XDIFF_OBJS > > VCSSVN_OBJS > > > > By doing this we avoid duplication of text between the Makefile and > > the CMake script. > > Thanks, this makes perfect sense, but it probably should have been > done from the very beginning, without copying the huge list manually > in the step [01/11]. > > How robust is the "parser"? Do we need to leave an instruction to > Makefile writers to conform to certain style to help CMake users as > an additional comment in the Makefile, or is any reasonable textual > drift still accepted? >
The parser just uses a regex capture like this "SCRIPT_SH += (.*)". If the current source/script definition in the Makefile is continued things will be fine.
On a side note, why are we using SCRIPT_SH and SCRIPT_LIB separately? Can't we combine them into one? If we can then I can also add it to the list above.
Thank You, Sibi Siddharthan