Skip to contentSkip to conversation

DocBook: Cleanup: remove an unused $(call) line

PATCH In review Mauro Carvalho Chehab 2 participants 5 messages Nov 19, 2015 – Nov 25, 2015 1 message not in the archive

Subsystems (2)
lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw

PATCH 1/3 DocBook: Add a help message for DOCBOOKS env var

Sometimes, it is needed to compile only a subset of the possible DocBooks. This is supported by the building system, but it is not docummented. Add a documentation for it.

---
 Documentation/DocBook/Makefile | 4 ++++
 1 file changed, 4 insertions(+)
Documentation/DocBook/Makefile +4 -0
index 91f6d89bb19f..bab296c5f565 100644
@@ -227,6 +227,10 @@ dochelp:
 	@echo  '  mandocs         - man pages'
 	@echo  '  installmandocs  - install man pages generated by mandocs'
 	@echo  '  cleandocs       - clean all generated DocBook files'
+	@echo
+	@echo  'make DOCBOOKS="s1.xml s2.xml" [target] Generate only docs s1.xml s2.xml'
+	@echo  '  valid values for DOCBOOKS are: $(DOCBOOKS)'
+
 
 ###
 # Temporary files left by various tools
Signature · 1 line
2.5.0
#2 lore raw

PATCH 2/3 DocBook: Cleanup: remove an unused $(call) line

In reply to a message not in the archive

There's no build_images function to call. So remove it.

This is just a cleanup patch, with doesn't affect the build.

---
 Documentation/DocBook/Makefile | 1 -
 1 file changed, 1 deletion(-)
Documentation/DocBook/Makefile +0 -1
index bab296c5f565..5b4176673ada 100644
@@ -51,7 +51,6 @@ pdfdocs: $(PDF)
 HTML := $(sort $(patsubst %.xml, %.html, $(BOOKS)))
 htmldocs: $(HTML)
 	$(call build_main_index)
-	$(call build_images)
 	$(call install_media_images)
 
 MAN := $(patsubst %.xml, %.9, $(BOOKS))
Signature · 1 line
2.5.0
#3 lore raw

PATCH 3/3 DocBook: make index.html generation less verbose by default

In reply to a message not in the archive

When make htmldocs is called on non-verbose mode, it will still be verbose with index.html generation for no good reason, printing:

	rm -rf Documentation/DocBook/index.html; echo '<h1>Linux Kernel HTML Documentation</h1>' >> Documentation/DocBook/index.html && echo '<h2>Kernel Version: 4.4.0-rc1</h2>' >> Documentation/DocBook/index.html && cat Documentation/DocBook/iio.html >> Documentation/DocBook/index.html

Instead, use the standard non-verbose mode, using:

HTML Documentation/DocBook/index.html

if not called with V=1.

---
 Documentation/DocBook/Makefile | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
Documentation/DocBook/Makefile +3 -2
index 5b4176673ada..d70f9b68174e 100644
@@ -50,7 +50,7 @@ pdfdocs: $(PDF)
 
 HTML := $(sort $(patsubst %.xml, %.html, $(BOOKS)))
 htmldocs: $(HTML)
-	$(call build_main_index)
+	$(call cmd,build_main_index)
 	$(call install_media_images)
 
 MAN := $(patsubst %.xml, %.9, $(BOOKS))
@@ -138,7 +138,8 @@ quiet_cmd_db2pdf = PDF     $@
 
 index = index.html
 main_idx = $(obj)/$(index)
-build_main_index = rm -rf $(main_idx); \
+quiet_cmd_build_main_index = HTML    $(main_idx)
+      cmd_build_main_index = rm -rf $(main_idx); \
 		   echo '<h1>Linux Kernel HTML Documentation</h1>' >> $(main_idx) && \
 		   echo '<h2>Kernel Version: $(KERNELVERSION)</h2>' >> $(main_idx) && \
 		   cat $(HTML) >> $(main_idx)
Signature · 1 line
2.5.0
#4 lore raw

Re: [PATCH 3/3] DocBook: make index.html generation less verbose by default

Quoted 5 lines · Mauro Carvalho Chehab

When make htmldocs is called on non-verbose mode, it will still be verbose with index.html generation for no good reason, printing:

        rm -rf Documentation/DocBook/index.html; echo '<h1>Linux Kernel HTML Documentation</h1>' >> Documentation/DocBook/index.html && echo '<h2>Kernel Version: 4.4.0-rc1</h2>' >> Documentation/DocBook/index.html && cat Documentation/DocBook/iio.html >> Documentation/DocBook/index.html
Quoted 7 lines

Instead, use the standard non-verbose mode, using:

HTML Documentation/DocBook/index.html

if not called with V=1.

Interesting, but seems to fail for e.g. gpu.xml:

$ git clean -dfx Documentation/
$ make DOCBOOKS="gpu.xml" htmldocs
 HOSTCC  scripts/basic/fixdep
 HOSTCC  scripts/docproc
 HOSTCC  scripts/check-lc_ctype
 DOCPROC Documentation/DocBook/gpu.xml

... lots of warnings about kerneldoc issues in gpu.xml

XMLREF Documentation/DocBook/gpu.aux.xml
HTML Documentation/DocBook/gpu.html
rm -rf Documentation/DocBook/index.html; echo '<h1>Linux Kernel HTML Documentation</h1>' >> Documentation/DocBook/index.html && echo '<h2>Kernel Version: 4.4.0-rc2</h2>' >> Documentation/DocBook/index.html && cat Documentation/DocBook/gpu.html >> Documentation/DocBook/index.html
cp: cannot stat ‘./Documentation/DocBook//bayer.png’: No such file or directory
cp: cannot stat ‘./Documentation/DocBook//constraints.png’: No such file or directory
cp: cannot stat ‘./Documentation/DocBook//crop.gif’: No such file or directory
cp: cannot stat ‘./Documentation/DocBook//dvbstb.png’: No such file or directory
cp: cannot stat ‘./Documentation/DocBook//fieldseq_bt.gif’: No such file or directory
cp: cannot stat ‘./Documentation/DocBook//fieldseq_tb.gif’: No such file or directory
cp: cannot stat ‘./Documentation/DocBook//nv12mt.gif’: No such file or directory
cp: cannot stat ‘./Documentation/DocBook//nv12mt_example.gif’: No such file or directory
cp: cannot stat ‘./Documentation/DocBook//pipeline.png’: No such file or directory
cp: cannot stat ‘./Documentation/DocBook//selection.png’: No such file or directory
cp: cannot stat ‘./Documentation/DocBook//vbi_525.gif’: No such file or directory
cp: cannot stat ‘./Documentation/DocBook//vbi_625.gif’: No such file or directory
cp: cannot stat ‘./Documentation/DocBook//vbi_hsync.gif’: No such file or directory
Documentation/DocBook/Makefile:55: recipe for target 'htmldocs' failed
make[1]: [htmldocs] Error 1 (ignored)

Once I've built media_api.xml the above goes away and then I get a new warning when trying to rebuild:

$ make DOCBOOKS="media_api.xml" htmldocs      

... output cut ...

$ make DOCBOOKS="gpu.xml" htmldocs      
rm -rf Documentation/DocBook/index.html; echo '<h1>Linux Kernel HTML Documentation</h1>' >> Documentation/DocBook/index.html && echo '<h2>Kernel Version: 4.4.0-rc2</h2>' >> Documentation/DocBook/index.html && cat Documentation/DocBook/gpu.html >> Documentation/DocBook/index.html
mkdir: cannot create directory ‘./Documentation/DocBook//media_api’: File exists

Cheers, Daniel

Quoted 31 lines
---
 Documentation/DocBook/Makefile | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
Documentation/DocBook/Makefile +3 -3
index 5b4176673ada..d70f9b68174e 100644
@@ -50,7 +50,7 @@ pdfdocs: $(PDF)
 
 HTML := $(sort $(patsubst %.xml, %.html, $(BOOKS)))
 htmldocs: $(HTML)
-       $(call build_main_index)
+       $(call cmd,build_main_index)
        $(call install_media_images)
 
 MAN := $(patsubst %.xml, %.9, $(BOOKS))
@@ -138,7 +138,8 @@ quiet_cmd_db2pdf = PDF     $@
 
 index = index.html
 main_idx = $(obj)/$(index)
-build_main_index = rm -rf $(main_idx); \
+quiet_cmd_build_main_index = HTML    $(main_idx)
+      cmd_build_main_index = rm -rf $(main_idx); \
                   echo '<h1>Linux Kernel HTML Documentation</h1>' >> $(main_idx) && \
                   echo '<h2>Kernel Version: $(KERNELVERSION)</h2>' >> $(main_idx) && \
                   cat $(HTML) >> $(main_idx)
--

2.5.0

Signature · 3 lines
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch
#5 lore raw

Re: [PATCH 3/3] DocBook: make index.html generation less verbose by default

Em Wed, 25 Nov 2015 12:40:38 +0100
Daniel Vetter <[email protected]> escreveu:

Quoted 44 lines · Mauro Carvalho Chehab
Quoted 5 lines

When make htmldocs is called on non-verbose mode, it will still be verbose with index.html generation for no good reason, printing:

        rm -rf Documentation/DocBook/index.html; echo '<h1>Linux Kernel HTML Documentation</h1>' >> Documentation/DocBook/index.html && echo '<h2>Kernel Version: 4.4.0-rc1</h2>' >> Documentation/DocBook/index.html && cat Documentation/DocBook/iio.html >> Documentation/DocBook/index.html
Quoted 7 lines

Instead, use the standard non-verbose mode, using:

HTML Documentation/DocBook/index.html

if not called with V=1.

Interesting, but seems to fail for e.g. gpu.xml:

$ git clean -dfx Documentation/
$ make DOCBOOKS="gpu.xml" htmldocs
 HOSTCC  scripts/basic/fixdep
 HOSTCC  scripts/docproc
 HOSTCC  scripts/check-lc_ctype
 DOCPROC Documentation/DocBook/gpu.xml

... lots of warnings about kerneldoc issues in gpu.xml

XMLREF Documentation/DocBook/gpu.aux.xml
HTML Documentation/DocBook/gpu.html
rm -rf Documentation/DocBook/index.html; echo '<h1>Linux Kernel HTML Documentation</h1>' >> Documentation/DocBook/index.html && echo '<h2>Kernel Version: 4.4.0-rc2</h2>' >> Documentation/DocBook/index.html && cat Documentation/DocBook/gpu.html >> Documentation/DocBook/index.html
cp: cannot stat ‘./Documentation/DocBook//bayer.png’: No such file or directory
cp: cannot stat ‘./Documentation/DocBook//constraints.png’: No such file or directory
cp: cannot stat ‘./Documentation/DocBook//crop.gif’: No such file or directory
cp: cannot stat ‘./Documentation/DocBook//dvbstb.png’: No such file or directory
cp: cannot stat ‘./Documentation/DocBook//fieldseq_bt.gif’: No such file or directory
cp: cannot stat ‘./Documentation/DocBook//fieldseq_tb.gif’: No such file or directory
cp: cannot stat ‘./Documentation/DocBook//nv12mt.gif’: No such file or directory
cp: cannot stat ‘./Documentation/DocBook//nv12mt_example.gif’: No such file or directory
cp: cannot stat ‘./Documentation/DocBook//pipeline.png’: No such file or directory
cp: cannot stat ‘./Documentation/DocBook//selection.png’: No such file or directory
cp: cannot stat ‘./Documentation/DocBook//vbi_525.gif’: No such file or directory
cp: cannot stat ‘./Documentation/DocBook//vbi_625.gif’: No such file or directory
cp: cannot stat ‘./Documentation/DocBook//vbi_hsync.gif’: No such file or directory
Documentation/DocBook/Makefile:55: recipe for target 'htmldocs' failed
make[1]: [htmldocs] Error 1 (ignored)

Quoted 1 line

Once I've built media_api.xml the above goes away

There's actually one patch fixing this at media tree:

Quoted 1 line

From d01b2d53a5a4db38c7c95651ca9ff23bb930844e Mon Sep 17 00:00:00 2001

From: Mauro Carvalho Chehab <[email protected]>
Date: Thu, 19 Nov 2015 07:41:40 -0200
Subject: [PATCH] DocBook: only copy stuff to media_api if media xml is
generated

It is possible to use:
make DOCBOOKS=device-drivers.xml htmldocs

To produce just a few docbooks. In such case, the media docs won't be built, causing the makefile target to return an error.

While this is ok for human eyes, if the above is used on an script, it would cause troubles.

Fix it by only creating/filling the media_api directory if the media_api.xml is found at DOCBOOKS.

Documentation/DocBook/media/Makefile +4 -2
index 02848146fc3a..2840ff483d5a 100644
@@ -199,8 +199,10 @@ DVB_DOCUMENTED = \
 #
 
 install_media_images = \
-	$(Q)-mkdir -p $(MEDIA_OBJ_DIR)/media_api; \
-	cp $(OBJIMGFILES) $(MEDIA_SRC_DIR)/*.svg $(MEDIA_SRC_DIR)/v4l/*.svg $(MEDIA_OBJ_DIR)/media_api
+	$(Q)if [ "x$(findstring media_api.xml,$(DOCBOOKS))" != "x" ]; then \
+		mkdir -p $(MEDIA_OBJ_DIR)/media_api; \
+		cp $(OBJIMGFILES) $(MEDIA_SRC_DIR)/*.svg $(MEDIA_SRC_DIR)/v4l/*.svg $(MEDIA_OBJ_DIR)/media_api; \
+	fi
 
 $(MEDIA_OBJ_DIR)/%: $(MEDIA_SRC_DIR)/%.b64
 	$(Q)base64 -d $< >$@
Quoted 9 lines

and then I get a new warning when trying to rebuild:

$ make DOCBOOKS="media_api.xml" htmldocs      

... output cut ...

$ make DOCBOOKS="gpu.xml" htmldocs      
rm -rf Documentation/DocBook/index.html; echo '<h1>Linux Kernel HTML Documentation</h1>' >> Documentation/DocBook/index.html && echo '<h2>Kernel Version: 4.4.0-rc2</h2>' >> Documentation/DocBook/index.html && cat Documentation/DocBook/gpu.html >> Documentation/DocBook/index.html
mkdir: cannot create directory ‘./Documentation/DocBook//media_api’: File exists

There are two other patches for Documentation/DocBook/media/Makefile that will fix this trouble.

Those patches are already at linux-next, via my tree.

Regards,
Mauro