> Then the make manual is a bit sloppy in the use of "whitespace". > E.g. from the man-page (3.3 Including Other Makefiles): > "Whitespace is required between include and the file names, and between file > names"
That sounded all too plausible, so I went through all the mentions of /whitespace/i in make.texi with the intent to produce a patch. I think you've got a good case with the quoted part of 3.3: martind@whitewater:~/playpen$ cat variable-include.make define VERTICAL_SPACE endef include $(VERTICAL_SPACE) filename.make martind@whitewater:~/playpen$ make -f variable-include.make variable-include.make:8: : No such file or directory make: *** No rule to make target ' '. Stop. martind@whitewater:~/playpen$ > (plus section 5.9 etc. etc.) I think Gisle refers to: >> It is sometimes useful to define recipes which do nothing. This is done >> simply by giving a recipe that consists of nothing but whitespace. For >> example: >> >> target: ; I tried a similar test case and that, unlike the 3.3 one, seemed to work: martind@whitewater:~/playpen$ cat vertical-whitespace-in-otherwise-empty-recipe.make define VERTICAL_SPACE endef mytarget: $(VERTICAL_SPACE); martind@whitewater:~/playpen$ make -f vertical-whitespace-in-otherwise-empty-recipe.make make: 'mytarget' is up to date. martind@whitewater:~/playpen$ The file command seems less tolerant: martind@whitewater:~/playpen$ cat vertical-whitespace-in-file-command.make define VERTICAL_SPACE endef $(file > $(VERTICAL_SPACE) file.txt,text) martind@whitewater:~/playpen$ rm -f file.txt; make -f vertical-whitespace-in-file-command.make; cat file.txt make: *** No targets. Stop. cat: file.txt: No such file or directory martind@whitewater:~/playpen$ echo *file.txt file.txt martind@whitewater:~/playpen$ rm *file.txt martind@whitewater:~/playpen$ Heh. So my suggestion would be: martind@whitewater:~/download/make-git/make/doc$ git diff diff --git a/doc/make.texi b/doc/make.texi index 8fbdb61..c7122ef 100644 --- a/doc/make.texi +++ b/doc/make.texi @@ -1173,9 +1173,9 @@ include @var{filenames}@dots{} Extra spaces are allowed and ignored at the beginning of the line, but the first character must not be a tab (or the value of @code{.RECIPEPREFIX})---if the line begins with a tab, it will be -considered a recipe line. Whitespace is required between +considered a recipe line. Horizontal whitespace is required between @code{include} and the file names, and between file names; extra -whitespace is ignored there and at the end of the directive. A +horizontal whitespace is ignored there and at the end of the directive. A comment starting with @samp{#} is allowed at the end of the line. If the file names contain any variable or function references, they are expanded. @xref{Using Variables, ,How to Use Variables}. @@ -7522,7 +7522,7 @@ $(file @var{op} @var{filename},@var{text}) The operator @var{op} can be either @code{>} which indicates overwrite mode, or @code{>>} which indicates append mode. The @var{filename} indicates the file to be written to. There may optionally be -whitespace between the operator and the file name. +horizontal whitespace between the operator and the file name. When the @code{file} function is expanded all its arguments are expanded first, then the file indicated by @var{filename} will be martind@whitewater:~/download/make-git/make/doc$ I think that I've (somewhat deliberately) missed the real point, about the syntax of makefiles, rather than the semantics. Perhaps that's the purview of 3.1 What Makefiles Contain and 3.1.1 Splitting Long Lines. Perhaps that could afford to be explicit that directives, except for define, are terminated by an unescaped newline. -----Original Message----- From: bug-make-bounces+martin.dorey=hds....@gnu.org [mailto:bug-make-bounces+martin.dorey=hds....@gnu.org] On Behalf Of Gisle Vanem Sent: Thursday, April 03, 2014 07:37 To: bug-make@gnu.org Subject: Re: Excessive $(strip) "Martin Dorey" <martin.do...@hds.com> wrote: >> this also removes the newlines. >... >> IMHO make 4.x has a too strict definition of white-space. > > http://pubs.opengroup.org/onlinepubs/000095399/basedefs/xbd_chap07.html > sayeth: > > "In the POSIX locale, at a minimum, the <space>, <form-feed>, <newline>, > <carriage-return>, <tab>, and <vertical-tab> shall be included." Then the make manual is a bit sloppy in the use of "whitespace". E.g. from the man-page (3.3 Including Other Makefiles): "Whitespace is required between include and the file names, and between file names" (plus section 5.9 etc. etc.) So a: include foo.mak --- should work if that definition was true everywhere, but it doesn't. --gv _______________________________________________ Bug-make mailing list Bug-make@gnu.org https://lists.gnu.org/mailman/listinfo/bug-make _______________________________________________ Bug-make mailing list Bug-make@gnu.org https://lists.gnu.org/mailman/listinfo/bug-make