git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] Makefile: don't run rm without any files

From
Jonathan Nieder <jrnieder@gmail.com>
Date
Feb 13, 2013, 20:12 UTC
Message-ID
<20130213201244.GD3381@google.com>
In-Reply-To
<7vehgk6l11.fsf@alter.siamese.dyndns.org>
Junio C Hamano wrote:
Show 11 quoted lines
> I amended the log message like so:
>
> commit bd9df384b16077337fffe9836c9255976b0e7b91
> Author: Matt Kraai <matt.kraai@amo.abbott.com>
> Date:   Wed Feb 13 07:57:48 2013 -0800
>
>     Makefile: don't run rm without any files
>
>     When COMPUTE_HEADER_DEPENDENCIES is set to "auto" and the compiler
>     does not support it, $(dep_dirs) becomes empty.  "make clean" runs
>     "rm -rf $(dep_dirs)", which fails in such a case.

To pedantic, that only fails on some platforms. The autoconf manual explains:

	It is not portable to invoke rm without options or operands. On the
	other hand, Posix now requires rm -f to silently succeed when there are
	no operands (useful for constructs like rm -rf $filelist without first
	checking if ‘$filelist’ was empty). But this was not always portable; at
	least NetBSD rm built before 2008 would fail with a diagnostic.
Anyway, looks like a good fix.  Thanks.
Previous: Junio C Hamano
Message 5 of 5 in “Makefile: don't run rm without any files”
  1. Makefile: don't run rm without any filesMatt Kraai, Feb 13, 2013
  2. Junio C HamanoFeb 13, 2013
  3. Matt KraaiFeb 13, 2013
  4. Junio C HamanoFeb 13, 2013
  5. Jonathan NiederFeb 13, 2013

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.