From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from pfepb.post.tele.dk ([195.41.46.236]:53913 "EHLO pfepb.post.tele.dk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S937023AbZDJUrZ (ORCPT ); Fri, 10 Apr 2009 16:47:25 -0400 Date: Fri, 10 Apr 2009 22:49:30 +0200 From: Sam Ravnborg Subject: Re: [PATCH?] docbook: make cleandocs Message-ID: <20090410204930.GA26185@uranus.ravnborg.org> References: <20090410133538.fa2b9798.randy.dunlap@oracle.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20090410133538.fa2b9798.randy.dunlap@oracle.com> Sender: linux-kbuild-owner@vger.kernel.org List-ID: To: Randy Dunlap Cc: linux-kbuild@vger.kernel.org, linux-doc@vger.kernel.org On Fri, Apr 10, 2009 at 01:35:38PM -0700, Randy Dunlap wrote: > Hi Sam, > > "make clean" cleans DocBook generated files, but I would like a way to > clean _only_ those generated files. Something like the patch below, > except that it doesn't work. :( > > Can you give me ideas of how to fix it, please? > > Thanks, > --- > ~Randy > > > > > From: Randy Dunlap > > Add a 'make cleandocs' target to clean up all generated > DocBook files. > > Signed-off-by: Randy Dunlap > --- > Documentation/DocBook/Makefile | 15 ++++++++++++--- > 1 file changed, 12 insertions(+), 3 deletions(-) > > --- linux-2.6.30-rc1-git3.orig/Documentation/DocBook/Makefile > +++ linux-2.6.30-rc1-git3/Documentation/DocBook/Makefile > @@ -31,7 +31,7 @@ PS_METHOD = $(prefer-db2x) > > ### > # The targets that may be used. > -PHONY += xmldocs sgmldocs psdocs pdfdocs htmldocs mandocs installmandocs > +PHONY += xmldocs sgmldocs psdocs pdfdocs htmldocs mandocs installmandocs cleandocs > > BOOKS := $(addprefix $(obj)/,$(DOCBOOKS)) > xmldocs: $(BOOKS) > @@ -213,11 +213,12 @@ silent_gen_xml = : > dochelp: > @echo ' Linux kernel internal documentation in different formats:' > @echo ' htmldocs - HTML' > - @echo ' installmandocs - install man pages generated by mandocs' > - @echo ' mandocs - man pages' > @echo ' pdfdocs - PDF' > @echo ' psdocs - Postscript' > @echo ' xmldocs - XML DocBook' > + @echo ' mandocs - man pages' > + @echo ' installmandocs - install man pages generated by mandocs' > + @echo ' cleandocs - clean all generated DocBook files' > > ### > # Temporary files left by various tools > @@ -235,6 +236,14 @@ clean-files := $(DOCBOOKS) \ > > clean-dirs := $(patsubst %.xml,%,$(DOCBOOKS)) man > > +cleandocs: > + echo "clean-files: $(clean-files)" > + echo "clean-dirs: $(clean-dirs)" > + cd Documentation/DocBook > + rm -f $(clean-files) > + rm -rf $(clean-dirs) > + cd ../.. Each command are executed in their own shell. So the "cd Documentation/DocBook" will have no effect. You need to do something like: cd Documentation/DocBook && rm -f $(clean-files) && rm -rf $(clean-dirs) Or the one I would prefer: rm -f $(call objectify, $(clean-files)) rm -rf $(call objectify, $(clean-dirs)) In the command section of the above rule. Sam