# [PATCH] When generating manpages, delete outdated targets first.

2 messages from 2007-08-01 to 2007-08-02. Participants: David Kastrup, Junio C Hamano.
Thread: https://gitlist.dev/t/9346

## David Kastrup, 2007-08-01 23:48

Subject: [PATCH] When generating manpages, delete outdated targets first.
Message-ID: <S1753674AbXHBABb/20070802000131Z+363@vger.kernel.org>
URL: https://gitlist.dev/e/S1753674AbXHBABb%2F20070802000131Z%2B363%40vger.kernel.org

```
This makes "make doc" work even if you made "sudo make doc" previously
by mistake.  Apparently an oversight: the other targets did this already.

Signed-off-by: David Kastrup <dak@gnu.org>
---
 Documentation/Makefile |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/Documentation/Makefile b/Documentation/Makefile
index 3bc5357..a186843 100644
--- a/Documentation/Makefile
+++ b/Documentation/Makefile
@@ -120,6 +120,7 @@ clean:
 	mv $@+ $@
 
 %.1 %.5 %.7 : %.xml
+	$(RM) $@+ $@
 	xmlto -m callouts.xsl man $<
 
 %.xml : %.txt
-- 
1.5.3.rc2.167.gbef44-dirty

```

## Junio C Hamano, 2007-08-02 00:53

Subject: Re: [PATCH] When generating manpages, delete outdated targets first.
Message-ID: <7vlkcu3gfo.fsf@assigned-by-dhcp.cox.net>
URL: https://gitlist.dev/e/7vlkcu3gfo.fsf%40assigned-by-dhcp.cox.net
In-Reply-To: <S1753674AbXHBABb/20070802000131Z+363@vger.kernel.org>

```
David Kastrup <dak@gnu.org> writes:

> This makes "make doc" work even if you made "sudo make doc" previously
> by mistake.  Apparently an oversight: the other targets did this already.
>
> Signed-off-by: David Kastrup <dak@gnu.org>
> ---
>  Documentation/Makefile |    1 +
>  1 files changed, 1 insertions(+), 0 deletions(-)
>
> diff --git a/Documentation/Makefile b/Documentation/Makefile
> index 3bc5357..a186843 100644
> --- a/Documentation/Makefile
> +++ b/Documentation/Makefile
> @@ -120,6 +120,7 @@ clean:
>  	mv $@+ $@
>  
>  %.1 %.5 %.7 : %.xml
> +	$(RM) $@+ $@
>  	xmlto -m callouts.xsl man $<
>  
>  %.xml : %.txt

I think "rm" makes sense; the call to xmlto in this Makefile has
been this way from day one, it seems ;-).

The build rule for this target does not use "generate to
temporary $@+ and after that is successful mv to the final $@"
pattern, so we do not have to remove $@+ in this target, though.

Thanks.

```
