[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: Excessive $(strip)
From: |
Martin Dorey |
Subject: |
RE: Excessive $(strip) |
Date: |
Thu, 3 Apr 2014 21:17:39 +0000 |
> 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:
address@hidden:~/playpen$ cat variable-include.make
define VERTICAL_SPACE
endef
include $(VERTICAL_SPACE) filename.make
address@hidden:~/playpen$ make -f variable-include.make
variable-include.make:8:
: No such file or directory
make: *** No rule to make target '
'. Stop.
address@hidden:~/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:
address@hidden:~/playpen$ cat
vertical-whitespace-in-otherwise-empty-recipe.make
define VERTICAL_SPACE
endef
mytarget: $(VERTICAL_SPACE);
address@hidden:~/playpen$ make -f
vertical-whitespace-in-otherwise-empty-recipe.make
make: 'mytarget' is up to date.
address@hidden:~/playpen$
The file command seems less tolerant:
address@hidden:~/playpen$ cat vertical-whitespace-in-file-command.make
define VERTICAL_SPACE
endef
$(file > $(VERTICAL_SPACE) file.txt,text)
address@hidden:~/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
address@hidden:~/playpen$ echo *file.txt
file.txt
address@hidden:~/playpen$ rm *file.txt
address@hidden:~/playpen$
Heh. So my suggestion would be:
address@hidden:~/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 @address@hidden
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
address@hidden:~/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: address@hidden [mailto:address@hidden On Behalf Of Gisle Vanem
Sent: Thursday, April 03, 2014 07:37
To: address@hidden
Subject: Re: Excessive $(strip)
"Martin Dorey" <address@hidden> 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
address@hidden
https://lists.gnu.org/mailman/listinfo/bug-make