help-make
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Parsing the Makefiles


From: Paul Smith
Subject: Re: Parsing the Makefiles
Date: Sat, 28 Nov 2020 17:03:56 -0500
User-agent: Evolution 3.36.4-0ubuntu1

On Sat, 2020-11-28 at 12:57 +0000, Peter Bocan wrote:
> - Is there any sort of EBNF grammar description of the Makefile
> format? 

Not really.  GNU make uses a hand-tooled parser.

> - As far as I understand it, the Make processes Makefiles based on
> lines, is that correct?

Yes... but logical lines not physical lines.

> - how does Make differentiate if the target of a rule is a file or
> not? I have noticed that there are occurrences where files are
> checking for  „.o“ files.

I'm not sure what you mean: all targets represent files as far as make
is concerned.

> - when does the recipe definition end? If I have a blank line in
> between the recipe lines, should the recipe continue?

Yes.  A rule only ends when the next non-recipe line is read.  Blank
lines, comments, even ifdef-type lines don't end a rule.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]