It might be useful to consider 'make', a.k.a., GNUmake, as a language and to organize the manual around this notion. In descriptions of computer languages it is seen as useful to define the lexical structure, including keywords, prior to defining the sentential structure prior to in-depth explanations of features. In looking at the current manual I think this this would fit well and do much to providing a framework for reading the manual. For example, what is a filename lexical structure, a target, reserved name, and archive, and so on. And then, what is the general nature of valid sentences in the language.

From what I have been able to gather:

target       : [[:alphanum:]]+

prerequisite : name+.name*
             | name
             | name(name)

name         : localName
             | keyword      ???

recipe       : ?

localName    : [[:alphanum:]]+

keyword      : [[:ALPHA:]]+
             | '.' [[:ALHPA:]]+

derefname    : $(localName)

sentences    : rule | assignment | keyword | ...

rule         : target_list ':' prerequisite_list ; recipe recipe_list
             | target_list ':'prerequisite_list recipe_list

recipe_list  : recipe_list recipe
             | <newline>$(..RECIPEPREFIX) recipe
             |

and so on. I'm only on Chapter 4.0 so I'm sure, absolutely sure, that this is wrong, and/or incomplete.

This is the issue. The manual spreads lexical and parse definitions throughout. Often, a new lexical/parsing item is introduced as part of an example, and often with a forward reference. But nowhere is this information collected and presented as part of the manual preliminaries. It almost seems (to me) that in order to understand Chapter 2-4 I have to read the remainder of the manual, and then go back to the overview topics in these chapters.

For example, on pg. 24  'OBJS := $(addprefix $(OBJDIR)/,foo.o bar.o baz.o)' is given. Nowhere, up to this point, is this syntax described. For example, what is an 'addprefix'? Why is there a space? What is the syntax of the right hand side of a localName? Do localNames have to be capitalized? And so on.

As a separate item, throughout what I have read here is a reference to a 'filename'. I believe that this is incorrect in each instance that it is mentioned. The 'filename' can be a reference to a directory, filename, local name, or anything. This being said, nowhere is the lexical definition or sentential structure presented up to this point. For example, can filenames be replaced by an archive (alpha(alpha))? It would be helpful to know the basic lexical structure before the chapters are read (see above note).

In other respects I think that the manual is very good.

If I can be of any assistance in rewriting portions of the manual, I would gladly take a hand at it.

thanks for you good work;
art


Reply via email to