public inbox for linux-kbuild@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH?] docbook: make cleandocs
@ 2009-04-10 20:35 Randy Dunlap
  2009-04-10 20:49 ` Sam Ravnborg
  0 siblings, 1 reply; 4+ messages in thread
From: Randy Dunlap @ 2009-04-10 20:35 UTC (permalink / raw)
  To: linux-kbuild; +Cc: linux-doc, samr

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 <randy.dunlap@oracle.com>

Add a 'make cleandocs' target to clean up all generated
DocBook files.

Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
---
 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 ../..
+
 # Declare the contents of the .PHONY variable as phony.  We keep that
 # information in a variable se we can use it in if_changed and friends.
 

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH?] docbook: make cleandocs
  2009-04-10 20:35 [PATCH?] docbook: make cleandocs Randy Dunlap
@ 2009-04-10 20:49 ` Sam Ravnborg
  2009-04-10 21:20   ` [PATCH v2] " Randy Dunlap
  0 siblings, 1 reply; 4+ messages in thread
From: Sam Ravnborg @ 2009-04-10 20:49 UTC (permalink / raw)
  To: Randy Dunlap; +Cc: linux-kbuild, linux-doc

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 <randy.dunlap@oracle.com>
> 
> Add a 'make cleandocs' target to clean up all generated
> DocBook files.
> 
> Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
> ---
>  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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH v2] docbook: make cleandocs
  2009-04-10 20:49 ` Sam Ravnborg
@ 2009-04-10 21:20   ` Randy Dunlap
  2009-04-10 22:42     ` Sam Ravnborg
  0 siblings, 1 reply; 4+ messages in thread
From: Randy Dunlap @ 2009-04-10 21:20 UTC (permalink / raw)
  To: Sam Ravnborg; +Cc: Randy Dunlap, linux-kbuild, linux-doc

From: Randy Dunlap <randy.dunlap@oracle.com>

Add a 'make cleandocs' target to clean up all generated
DocBook files.

Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
---
 Documentation/DocBook/Makefile |   11 ++++++++---
 1 file changed, 8 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,10 @@ clean-files := $(DOCBOOKS) \
 
 clean-dirs := $(patsubst %.xml,%,$(DOCBOOKS)) man
 
+cleandocs:
+	$(Q)rm -f $(call objectify, $(clean-files))
+	$(Q)rm -rf $(call objectify, $(clean-dirs))
+
 # Declare the contents of the .PHONY variable as phony.  We keep that
 # information in a variable se we can use it in if_changed and friends.
 

-- 
~Randy

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH v2] docbook: make cleandocs
  2009-04-10 21:20   ` [PATCH v2] " Randy Dunlap
@ 2009-04-10 22:42     ` Sam Ravnborg
  0 siblings, 0 replies; 4+ messages in thread
From: Sam Ravnborg @ 2009-04-10 22:42 UTC (permalink / raw)
  To: Randy Dunlap; +Cc: linux-kbuild, linux-doc

On Fri, Apr 10, 2009 at 02:20:54PM -0700, Randy Dunlap wrote:
> From: Randy Dunlap <randy.dunlap@oracle.com>
> 
> Add a 'make cleandocs' target to clean up all generated
> DocBook files.

Applied,
	Sam

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2009-04-10 22:40 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-04-10 20:35 [PATCH?] docbook: make cleandocs Randy Dunlap
2009-04-10 20:49 ` Sam Ravnborg
2009-04-10 21:20   ` [PATCH v2] " Randy Dunlap
2009-04-10 22:42     ` Sam Ravnborg

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox