Implant kernel-doc from Linux kernel
cover Implant kernel-doc from Linux kernel
This patch series implants slightly modified kernel-doc documentation generator from Linux kernel into U-Boot. First patch pulls in all the necessary components with minor modifications made to them to work with the layout of U-Boot source tree and without kbuild.
Further patch implement CSS to make the HTML documentation look a bit nicer. This patch will eventually (hopefully) be further refined by someone more artistically capable than me ;-)
Next patch implements separate handling for "Example:" section, which in the original kernel-doc was in my opinion mistreated. The example section generated a block of code, but the indentation was removed. Thus this patch does avoid removing the indent.
Finally, the last patch implements example of how to use this kernel-doc to generate U-Boot documentation by documenting the Linker-Generated arrays.
NOTE: This patchset has a cross-dependency on:
[PATCH 0/5 V2] Linker-generated arrays
Marek Vasut (4):
doc: kerneldoc: Implant DocBook from Linux kernel
doc: kerneldoc: Add nicer CSS stylesheet for HTML docs
doc: kerneldoc: Implement "Example" section handling
doc: kerneldoc: tmpl: Implement template for LG-arrays
Makefile | 7 + doc/DocBook/Makefile | 227 ++++ doc/DocBook/docbook.css | 16 + doc/DocBook/linker_lists.tmpl | 46 + doc/DocBook/stylesheet.xsl | 11 + tools/kernel-doc/Makefile | 44 + tools/kernel-doc/docproc.c | 576 ++++++++++ tools/kernel-doc/kernel-doc | 2557 +++++++++++++++++++++++++++++++++++++++++ 8 files changed, 3484 insertions(+) create mode 100644 doc/DocBook/Makefile create mode 100644 doc/DocBook/docbook.css create mode 100644 doc/DocBook/linker_lists.tmpl create mode 100644 doc/DocBook/stylesheet.xsl create mode 100644 tools/kernel-doc/Makefile create mode 100644 tools/kernel-doc/docproc.c create mode 100755 tools/kernel-doc/kernel-doc
Signature · 1 line
1.7.10.4
PATCH 1/4 doc: kerneldoc: Implant DocBook from Linux kernel
Pull slightly modified version of Documentation/DocBook, the related perl script scripts/kernel-doc and the scripts/docproc.c from Linux kernel and implant it into U-Boot. This will allow smooth generation of kerneldoc style documentation.
It was necessary to modify the DocBook/Makefile to work with U-Boot build system. The changes were only minor though and involved replacing the kbuild specific parts.
It was also necessary to replace use of variables like KERNEL_VERSION with U_BOOT_VERSION, strings like Linux kernel with U-Boot Bootloader etc. so the generated result actually matches.
Finally, it was necessary to adjust docproc.c, since the documentation in U-Boot is located in doc/DocBook instead of Documentation/DocBook as is in case of the Linux kernel.
Some parts of the DocBook Makefile are unused, but to allow easier sync with Linux kernel, these parts are still left in. The targets enabled now are "htmldocs" "pdfdocs" "psdocs" "xmldocs" and "cleandocs" to remove the results of documentation build.
Linux scripts/docproc.c:
commit f0f3ca8d967462dafb815412b14ca3339b9817a6
Date: Wed Jun 15 11:53:13 2011 +0200
Linux scripts/kernel-doc:
commit 1b40c1944db445c1de1c47ffd8cd426167f488e8
Date: Sun Aug 12 10:46:15 2012 +0200
Linux Documentation/DocBook:
commit bb8187d35f820671d6dd76700d77a6b55f95e2c5
Date: Thu May 17 19:06:13 2012 -0400
--- Makefile | 7 + doc/DocBook/Makefile | 227 ++++ doc/DocBook/stylesheet.xsl | 10 + tools/kernel-doc/Makefile | 44 + tools/kernel-doc/docproc.c | 576 ++++++++++ tools/kernel-doc/kernel-doc | 2554 +++++++++++++++++++++++++++++++++++++++++++ 6 files changed, 3418 insertions(+) create mode 100644 doc/DocBook/Makefile create mode 100644 doc/DocBook/stylesheet.xsl create mode 100644 tools/kernel-doc/Makefile create mode 100644 tools/kernel-doc/docproc.c create mode 100755 tools/kernel-doc/kernel-doc
Makefile +7 -0
@@ -695,6 +695,12 @@ easylogo env gdb: $(MAKE) -C tools/$@ all MTD_VERSION=${MTD_VERSION} gdbtools: gdb +kernel-doc: + $(MAKE) -C tools/$@ all + +xmldocs pdfdocs psdocs htmldocs mandocs: + $(MAKE) U_BOOT_VERSION=$(U_BOOT_VERSION) -C doc/DocBook/ $@ + tools-all: easylogo env gdb $(VERSION_FILE) $(TIMESTAMP_FILE) $(MAKE) -C tools HOST_TOOLS_ALL=y
@@ -792,6 +798,7 @@ clean: @rm -f $(obj)include/generated/asm-offsets.h @rm -f $(obj)$(CPUDIR)/$(SOC)/asm-offsets.s @rm -f $(TIMESTAMP_FILE) $(VERSION_FILE) + @$(MAKE) -C doc/DocBook/ cleandoc @find $(OBJTREE) -type f \ \( -name 'core' -o -name '*.bak' -o -name '*~' -o -name '*.su' \ -o -name '*.o' -o -name '*.a' -o -name '*.exe' \) -print \
doc/DocBook/Makefile new file +227 -0
227 lines not on this page · raw message
doc/DocBook/stylesheet.xsl new file +10 -0
@@ -0,0 +1,10 @@ +<?xml version="1.0" encoding="UTF-8"?> +<stylesheet xmlns="http://www.w3.org/1999/XSL/Transform" version="1.0"> +<param name="chunk.quietly">1</param> +<param name="funcsynopsis.style">ansi</param> +<param name="funcsynopsis.tabular.threshold">80</param> +<param name="callout.graphics">0</param> +<!-- <param name="paper.type">A4</param> --> +<param name="generate.section.toc.level">2</param> +<param name="use.id.as.filename">1</param> +</stylesheet>
tools/kernel-doc/Makefile new file +44 -0
44 lines not on this page · raw message
tools/kernel-doc/docproc.c new file +576 -0
576 lines not on this page · raw message
tools/kernel-doc/kernel-doc new file +2554 -0
2,124 lines not on this page · raw message
The rest of this diff is not shown. View the raw message.
Signature · 1 line
1.7.10.4
Part of the diff is not shown here. View the raw message.
PATCH v2 1/4 doc: kerneldoc: Implant DocBook from Linux kernel
Pull slightly modified version of Documentation/DocBook, the related perl script scripts/kernel-doc and the scripts/docproc.c from Linux kernel and implant it into U-Boot. This will allow smooth generation of kerneldoc style documentation.
It was necessary to modify the DocBook/Makefile to work with U-Boot build system. The changes were only minor though and involved replacing the kbuild specific parts.
It was also necessary to replace use of variables like KERNEL_VERSION with U_BOOT_VERSION, strings like Linux kernel with U-Boot Bootloader etc. so the generated result actually matches.
Finally, it was necessary to adjust docproc.c, since the documentation in U-Boot is located in doc/DocBook instead of Documentation/DocBook as is in case of the Linux kernel.
Some parts of the DocBook Makefile are unused, but to allow easier sync with Linux kernel, these parts are still left in. The targets enabled now are "htmldocs" "pdfdocs" "psdocs" "xmldocs" and "cleandocs" to remove the results of documentation build.
Linux scripts/docproc.c:
commit f0f3ca8d967462dafb815412b14ca3339b9817a6
Date: Wed Jun 15 11:53:13 2011 +0200
Linux scripts/kernel-doc:
commit 1b40c1944db445c1de1c47ffd8cd426167f488e8
Date: Sun Aug 12 10:46:15 2012 +0200
Linux Documentation/DocBook:
commit bb8187d35f820671d6dd76700d77a6b55f95e2c5
Date: Thu May 17 19:06:13 2012 -0400
--- Makefile | 7 +- doc/DocBook/.gitignore | 15 + doc/DocBook/Makefile | 229 ++++ doc/DocBook/stylesheet.xsl | 10 + tools/.gitignore | 1 + tools/Makefile | 2 +- tools/kernel-doc/Makefile | 38 + tools/kernel-doc/docproc.c | 576 ++++++++++ tools/kernel-doc/kernel-doc | 2554 +++++++++++++++++++++++++++++++++++++++++++ 9 files changed, 3430 insertions(+), 2 deletions(-) create mode 100644 doc/DocBook/.gitignore create mode 100644 doc/DocBook/Makefile create mode 100644 doc/DocBook/stylesheet.xsl create mode 100644 tools/kernel-doc/Makefile create mode 100644 tools/kernel-doc/docproc.c create mode 100755 tools/kernel-doc/kernel-doc
V2: Add .gitignore, drop kernel-doc target which was bogus
Makefile +6 -1
@@ -695,6 +695,9 @@ easylogo env gdb: $(MAKE) -C tools/$@ all MTD_VERSION=${MTD_VERSION} gdbtools: gdb +xmldocs pdfdocs psdocs htmldocs mandocs: tools/kernel-doc/docproc + $(MAKE) U_BOOT_VERSION=$(U_BOOT_VERSION) -C doc/DocBook/ $@ + tools-all: easylogo env gdb $(VERSION_FILE) $(TIMESTAMP_FILE) $(MAKE) -C tools HOST_TOOLS_ALL=y
@@ -779,7 +782,8 @@ clean: $(obj)tools/mk{env,}image $(obj)tools/mpc86x_clk \ $(obj)tools/mk{smdk5250,}spl \ $(obj)tools/mxsboot \ - $(obj)tools/ncb $(obj)tools/ubsha1 + $(obj)tools/ncb $(obj)tools/ubsha1 \ + $(obj)tools/kernel-doc/docproc @rm -f $(obj)board/cray/L1/{bootscript.c,bootscript.image} \ $(obj)board/matrix_vision/*/bootscript.img \ $(obj)board/voiceblue/eeprom \
@@ -792,6 +796,7 @@ clean: @rm -f $(obj)include/generated/asm-offsets.h @rm -f $(obj)$(CPUDIR)/$(SOC)/asm-offsets.s @rm -f $(TIMESTAMP_FILE) $(VERSION_FILE) + @$(MAKE) -C doc/DocBook/ cleandocs @find $(OBJTREE) -type f \ \( -name 'core' -o -name '*.bak' -o -name '*~' -o -name '*.su' \ -o -name '*.o' -o -name '*.a' -o -name '*.exe' \) -print \
doc/DocBook/.gitignore new file +15 -0
@@ -0,0 +1,15 @@ +*/ +*.xml +*.ps +*.pdf +*.html +*.9.gz +*.9 +*.aux +*.dvi +*.log +*.out +*.png +*.gif +media-indices.tmpl +media-entities.tmpl
doc/DocBook/Makefile new file +229 -0
229 lines not on this page · raw message
doc/DocBook/stylesheet.xsl new file +10 -0
@@ -0,0 +1,10 @@ +<?xml version="1.0" encoding="UTF-8"?> +<stylesheet xmlns="http://www.w3.org/1999/XSL/Transform" version="1.0"> +<param name="chunk.quietly">1</param> +<param name="funcsynopsis.style">ansi</param> +<param name="funcsynopsis.tabular.threshold">80</param> +<param name="callout.graphics">0</param> +<!-- <param name="paper.type">A4</param> --> +<param name="generate.section.toc.level">2</param> +<param name="use.id.as.filename">1</param> +</stylesheet>
tools/.gitignore +1 -0
@@ -17,3 +17,4 @@ /env/fw_printenv /gdb/gdbcont /gdb/gdbsend +/kernel-doc/docproc
tools/Makefile +1 -1
@@ -21,7 +21,7 @@ # MA 02111-1307 USA # -TOOLSUBDIRS = +TOOLSUBDIRS = kernel-doc # # Include this after HOSTOS HOSTARCH check
tools/kernel-doc/Makefile new file +38 -0
@@ -0,0 +1,38 @@ +# +# Copyright (C) 2012 Marek Vasut <[email protected]> +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation; either version 2 of +# the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, +# MA 02111-1307 USA +# + +include $(TOPDIR)/config.mk + +all: $(obj)docproc + +$(obj)docproc: docproc.c + $(HOSTCC) $(HOSTCFLAGS) $(HOSTLDFLAGS) -o $@ $^ + $(HOSTSTRIP) $@ + +clean: + rm -rf docproc + +######################################################################### + +# defines $(obj).depend target +include $(SRCTREE)/rules.mk + +sinclude $(obj).depend + +#########################################################################
tools/kernel-doc/docproc.c new file +576 -0
576 lines not on this page · raw message
tools/kernel-doc/kernel-doc new file +2554 -0
2,095 lines not on this page · raw message
The rest of this diff is not shown. View the raw message.
Signature · 1 line
1.7.10.4
Part of the diff is not shown here. View the raw message.
PATCH v2 1/4 doc: kerneldoc: Implant DocBook from Linux kernel
Hi Marek,
Comments based on the assumption that we want to sync with the Linux tools.
General comment/hypothetical question: would it not be simpler to patch the existing Linux tools in-place so that we can use them on the U-Boot tree?
Detailed comments below in this spirit; ignore if suggestion above is stupid/complicated/plain wrong/other(specify...or not).
Quoted 8 lines · Marek Vasut
Pull slightly modified version of
Documentation/DocBook, the related perl scriptscripts/kernel-docand thescripts/docproc.cfrom Linux kernel and implant it into U-Boot. This will allow smooth generation of kerneldoc style documentation.It was necessary to modify the DocBook/Makefile to work with U-Boot build system. The changes were only minor though and involved replacing the kbuild specific parts.
Is it possible to make replace these changes with an if/then/else conditional based on an external option? That would make it possible to try and backmerge them into the Linux version of kerneldoc.
Quoted 3 lines
It was also necessary to replace use of variables like
KERNEL_VERSIONwithU_BOOT_VERSION, strings like Linux kernel with U-Boot Bootloader etc. so the generated result actually matches.
Maybe make this change more general, i.e. replace KERNEL_VERSION with PROJECT_VERSION with a default value assuming Linux, make magic constant strings variables with a linux-friendly default, and make all those variables overridable from command line? We'd just have to have a small script to provide the U-Boot-sensible values.
Quoted 3 lines
Finally, it was necessary to adjust
docproc.c, since the documentation in U-Boot is located in doc/DocBook instead ofDocumentation/DocBookas is in case of the Linux kernel.
Does it not make sense to drop the change above and instead, symlink doc/ to Documentation/? We could keep the symlink for one release then switch to a true rename for the release after.
Amicalement,
Signature · 1 line
Albert.
PATCH v2 1/4 doc: kerneldoc: Implant DocBook from Linux kernel
Dear Albert ARIBAUD,
Quoted 8 lines
Hi Marek,
Comments based on the assumption that we want to sync with the Linux tools.
General comment/hypothetical question: would it not be simpler to patch the existing Linux tools in-place so that we can use them on the U-Boot tree?
Yes, it is a good idea. I'll do that. The problem is, replies to my patches do documentation mailing lists are slow, that's for one thing.
The other, much more grave and unpleasant is that we're way too far behind the DM schedule. I don't know what to do, but since pushing stuff upstream goes much slower than I expected, I will soon be left with no option other than forking u- boot, finishing the university project and -- at the end, without the team -- merge the stuff slowly back upstream.
The patchsets are starting to depend one on another, so nothing gets in without something else etc ...
Quoted 9 lines
Detailed comments below in this spirit; ignore if suggestion above is stupid/complicated/plain wrong/other(specify...or not).
Quoted 5 lines · Marek Vasut
Pull slightly modified version of
Documentation/DocBook, the related perl scriptscripts/kernel-docand thescripts/docproc.cfrom Linux kernel and implant it into U-Boot. This will allow smooth generation of kerneldoc style documentation.
Quoted 7 lines
Quoted 3 lines
It was necessary to modify the DocBook/Makefile to work with U-Boot build system. The changes were only minor though and involved replacing the kbuild specific parts.
Is it possible to make replace these changes with an if/then/else conditional based on an external option? That would make it possible to try and backmerge them into the Linux version of kerneldoc.
Yes, it would ... while I already see how Linux people would hate it.
Quoted 9 lines
Quoted 3 lines
It was also necessary to replace use of variables like
KERNEL_VERSIONwithU_BOOT_VERSION, strings like Linux kernel with U-Boot Bootloader etc. so the generated result actually matches.Maybe make this change more general, i.e. replace
KERNEL_VERSIONwithPROJECT_VERSIONwith a default value assuming Linux, make magic constant strings variables with a linux-friendly default, and make all those variables overridable from command line? We'd just have to have a small script to provide the U-Boot-sensible values.
Yes, this would be easy. But see above.
Quoted 7 lines
Quoted 3 lines
Finally, it was necessary to adjust
docproc.c, since the documentation in U-Boot is located in doc/DocBook instead ofDocumentation/DocBookas is in case of the Linux kernel.Does it not make sense to drop the change above and instead, symlink doc/ to
Documentation/? We could keep the symlink for one release then switch to a true rename for the release after.
I'd hate to do so ... is there any reason? An environment variable would be much easier, docproc already uses them a bit.
Quoted 1 line
Amicalement,
Best regards,
Marek Vasut
PATCH v2 1/4 doc: kerneldoc: Implant DocBook from Linux kernel
Hi Marek,
Quoted 11 lines · Marek Vasut
Dear Albert ARIBAUD,
Quoted 8 lines
Hi Marek,
Comments based on the assumption that we want to sync with the Linux tools.
General comment/hypothetical question: would it not be simpler to patch the existing Linux tools in-place so that we can use them on the U-Boot tree?
Quoted 8 lines
Yes, it is a good idea. I'll do that. The problem is, replies to my patches do documentation mailing lists are slow, that's for one thing.
The other, much more grave and unpleasant is that we're way too far behind the DM schedule. I don't know what to do, but since pushing stuff upstream goes much slower than I expected, I will soon be left with no option other than forking u- boot, finishing the university project and -- at the end, without the team -- merge the stuff slowly back upstream.
If I were in your position, I would not hesitate for a minute to do a fork. The beauty of the FLOSS model of development is that forking is trivial and if the fork has worthy features, merging later will meet with general enthusiasm from the community. The merge will probably happen faster than you think (and may actually happen in parallel so that when your project finishes, more than half of your work has already been integrated)
And once you fork, all the bottlenecks of global community approval disappear.
Regards,
Graeme
PATCH v2 1/4 doc: kerneldoc: Implant DocBook from Linux kernel
Dear Graeme Russ,
Quoted 17 lines
Hi Marek,
Quoted 14 lines · Marek Vasut
Dear Albert ARIBAUD,
Quoted 8 lines
Hi Marek,
Comments based on the assumption that we want to sync with the Linux tools.
General comment/hypothetical question: would it not be simpler to patch the existing Linux tools in-place so that we can use them on the U-Boot tree?
Yes, it is a good idea. I'll do that. The problem is, replies to my patches do documentation mailing lists are slow, that's for one thing.
Quoted 8 lines
Quoted 5 lines
The other, much more grave and unpleasant is that we're way too far behind the DM schedule. I don't know what to do, but since pushing stuff upstream goes much slower than I expected, I will soon be left with no option other than forking u- boot, finishing the university project and -- at the end, without the team -- merge the stuff slowly back upstream.
If I were in your position, I would not hesitate for a minute to do a fork.
I do, bloody damnit! Just remember how it ended last time -- the result was a stupid useless piece of crap which was never merged back. Lot of wasted time etc.
Quoted 6 lines
The beauty of the FLOSS model of development is that forking is trivial and if the fork has worthy features, merging later will meet with general enthusiasm from the community. The merge will probably happen faster than you think (and may actually happen in parallel so that when your project finishes, more than half of your work has already been integrated)
See above.
Quoted 2 lines
And once you fork, all the bottlenecks of global community approval disappear.
And the fork will be sheets of crap, one on another ... because there'll be no proper review.
My position is that I DO NOT WANT TO DO IT ... unless I'm pushed to do so by the circumstances. And I'm reaching that point :'-C
Quoted 3 lines
Regards,
Graeme
Best regards,
Marek Vasut
PATCH v2 1/4 doc: kerneldoc: Implant DocBook from Linux kernel
In reply to Marek VasutHi Marek,
Quoted 58 lines · Marek Vasut
Dear Albert ARIBAUD,
Quoted 8 lines
Hi Marek,
Comments based on the assumption that we want to sync with the Linux tools.
General comment/hypothetical question: would it not be simpler to patch the existing Linux tools in-place so that we can use them on the U-Boot tree?
Yes, it is a good idea. I'll do that. The problem is, replies to my patches do documentation mailing lists are slow, that's for one thing.
The other, much more grave and unpleasant is that we're way too far behind the DM schedule. I don't know what to do, but since pushing stuff upstream goes much slower than I expected, I will soon be left with no option other than forking u- boot, finishing the university project and -- at the end, without the team -- merge the stuff slowly back upstream.
The patchsets are starting to depend one on another, so nothing gets in without something else etc ...
Quoted 9 lines
Detailed comments below in this spirit; ignore if suggestion above is stupid/complicated/plain wrong/other(specify...or not).
Quoted 5 lines · Marek Vasut
Pull slightly modified version of
Documentation/DocBook, the related perl scriptscripts/kernel-docand thescripts/docproc.cfrom Linux kernel and implant it into U-Boot. This will allow smooth generation of kerneldoc style documentation.Quoted 7 lines
Quoted 3 lines
It was necessary to modify the DocBook/Makefile to work with U-Boot build system. The changes were only minor though and involved replacing the kbuild specific parts.
Is it possible to make replace these changes with an if/then/else conditional based on an external option? That would make it possible to try and backmerge them into the Linux version of kerneldoc.
Yes, it would ... while I already see how Linux people would hate it.
Quoted 9 lines
Quoted 3 lines
It was also necessary to replace use of variables like
KERNEL_VERSIONwithU_BOOT_VERSION, strings like Linux kernel with U-Boot Bootloader etc. so the generated result actually matches.Maybe make this change more general, i.e. replace
KERNEL_VERSIONwithPROJECT_VERSIONwith a default value assuming Linux, make magic constant strings variables with a linux-friendly default, and make all those variables overridable from command line? We'd just have to have a small script to provide the U-Boot-sensible values.Yes, this would be easy. But see above.
Quoted 4 lines
Quoted 3 lines
Finally, it was necessary to adjust
docproc.c, since the documentation in U-Boot is located in doc/DocBook instead ofDocumentation/DocBookas is in case of the Linux kernel.
Quoted 6 lines
Quoted 3 lines
Does it not make sense to drop the change above and instead, symlink doc/ to
Documentation/? We could keep the symlink for one release then switch to a true rename for the release after.I'd hate to do so ... is there any reason? An environment variable would be much easier, docproc already uses them a bit.
Good point. Actually, environment variables (or an overridable configuration file) may help alleviate all three points above, avoid if/then/else (yes, I understand Linux people may not like that)...
Quoted 2 lines
Best regards,
Marek Vasut
Amicalement,
Signature · 1 line
Albert.
PATCH v2 1/4 doc: kerneldoc: Implant DocBook from Linux kernel
In reply to Albert ARIBAUDDear Albert ARIBAUD,
Quoted 11 lines
Hi Marek,
Comments based on the assumption that we want to sync with the Linux tools.
General comment/hypothetical question: would it not be simpler to patch the existing Linux tools in-place so that we can use them on the U-Boot tree?
Detailed comments below in this spirit; ignore if suggestion above is stupid/complicated/plain wrong/other(specify...or not).
[...]
Albert, can we just merge this version and resync when I get the patches into upstream Linux? This is blocking the LG-arrays and other patches dependent on them (like serial stuff).
The other option is to allow /** style comment. Wolfgang, can we do that?
Best regards,
Marek Vasut
PATCH 2/4 doc: kerneldoc: Add nicer CSS stylesheet for HTML docs
In reply to Marek VasutImport basic CSS stylesheet for the HTML documentation. The base for the stylesheet is taken from:
http://ds9a.nl/docbook/minimal-page.html
I customized the CSS a bit further, for example to add curvy corners to example section and change the tint of gray. The HTML documentation does not look that crude anymore.
--- doc/DocBook/docbook.css | 16 ++++++++++++++++ doc/DocBook/stylesheet.xsl | 1 + 2 files changed, 17 insertions(+) create mode 100644 doc/DocBook/docbook.css
doc/DocBook/docbook.css new file +16 -0
@@ -0,0 +1,16 @@ +body { + font-family: sans-serif; +} + +.programlisting { + font-family: monospace; + font-size: 1em; + display: block; + padding: 10px; + border: 1px solid #aaa; + color: #000; + background-color: #eee; + overflow: auto; + margin: 1em 0em; + border-radius: 6px; +}
doc/DocBook/stylesheet.xsl +1 -0
@@ -7,4 +7,5 @@ <!-- <param name="paper.type">A4</param> --> <param name="generate.section.toc.level">2</param> <param name="use.id.as.filename">1</param> +<param name="html.stylesheet">../docbook.css</param> </stylesheet>
Signature · 1 line
1.7.10.4
PATCH 3/4 doc: kerneldoc: Implement "Example" section handling
In reply to Marek VasutThe default kernel-doc strips starting spaces from every single line in the Example section. This makes the code look bad. Thus, implement special handling for this section.
--- tools/kernel-doc/kernel-doc | 3 +++ 1 file changed, 3 insertions(+)
tools/kernel-doc/kernel-doc +3 -0
@@ -2424,6 +2424,9 @@ sub process_file($) { # Continued declaration purpose chomp($declaration_purpose); $declaration_purpose .= " " . xml_escape($1); + } elsif ($section =~ m/^Example/) { + $_ =~ s/^\s*\*//; + $contents .= $_; } else { $contents .= $1 . "\n"; }
Signature · 1 line
1.7.10.4
PATCH 4/4 doc: kerneldoc: tmpl: Implement template for LG-arrays
In reply to Marek VasutImplement kerneldoc template for linker-generated arrays. This is the first template in U-Boot that is used to generate kerneldoc style documentation. This template is very basic.
--- doc/DocBook/Makefile | 2 +- doc/DocBook/linker_lists.tmpl | 46 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 47 insertions(+), 1 deletion(-) create mode 100644 doc/DocBook/linker_lists.tmpl
doc/DocBook/Makefile +1 -1
@@ -8,7 +8,7 @@ include $(TOPDIR)/config.mk -DOCBOOKS := +DOCBOOKS := linker_lists.xml ### # The build process is as follows (targets):
doc/DocBook/linker_lists.tmpl new file +46 -0
46 lines not on this page · raw message
Signature · 1 line
1.7.10.4
v2 cover Implant kernel-doc from Linux kernel
In reply to Marek VasutThis patch series implants slightly modified kernel-doc documentation generator from Linux kernel into U-Boot. First patch pulls in all the necessary components with minor modifications made to them to work with the layout of U-Boot source tree and without kbuild.
Further patch implement CSS to make the HTML documentation look a bit nicer. This patch will eventually (hopefully) be further refined by someone more artistically capable than me ;-)
Next patch implements separate handling for "Example:" section, which in the original kernel-doc was in my opinion mistreated. The example section generated a block of code, but the indentation was removed. Thus this patch does avoid removing the indent.
Finally, the last patch implements example of how to use this kernel-doc to generate U-Boot documentation by documenting the Linker-Generated arrays.
NOTE: This patchset (last patch) has a cross-dependency on:
[PATCH 0/5] Linker-generated arrays (take 2)
V2: Add proper .gitignore entries, fix build issues (fix Makefiles)
Marek Vasut (4):
doc: kerneldoc: Implant DocBook from Linux kernel
doc: kerneldoc: Add nicer CSS stylesheet for HTML docs
doc: kerneldoc: Implement "Example" section handling
doc: kerneldoc: tmpl: Implement template for LG-arrays
Makefile | 7 +- doc/DocBook/.gitignore | 15 + doc/DocBook/Makefile | 229 ++++ doc/DocBook/docbook.css | 16 + doc/DocBook/linker_lists.tmpl | 46 + doc/DocBook/stylesheet.xsl | 11 + tools/.gitignore | 1 + tools/Makefile | 2 +- tools/kernel-doc/Makefile | 38 + tools/kernel-doc/docproc.c | 576 ++++++++++ tools/kernel-doc/kernel-doc | 2557 +++++++++++++++++++++++++++++++++++++++++ 11 files changed, 3496 insertions(+), 2 deletions(-) create mode 100644 doc/DocBook/.gitignore create mode 100644 doc/DocBook/Makefile create mode 100644 doc/DocBook/docbook.css create mode 100644 doc/DocBook/linker_lists.tmpl create mode 100644 doc/DocBook/stylesheet.xsl create mode 100644 tools/kernel-doc/Makefile create mode 100644 tools/kernel-doc/docproc.c create mode 100755 tools/kernel-doc/kernel-doc
Signature · 1 line
1.7.10.4
PATCH 1/4 doc: kerneldoc: Implant DocBook from Linux kernel
Pull slightly modified version of Documentation/DocBook, the related perl script scripts/kernel-doc and the scripts/docproc.c from Linux kernel and implant it into U-Boot. This will allow smooth generation of kerneldoc style documentation.
It was necessary to modify the DocBook/Makefile to work with U-Boot build system. The changes were only minor though and involved replacing the kbuild specific parts.
It was also necessary to replace use of variables like KERNEL_VERSION with U_BOOT_VERSION, strings like Linux kernel with U-Boot Bootloader etc. so the generated result actually matches.
Finally, it was necessary to adjust docproc.c, since the documentation in U-Boot is located in doc/DocBook instead of Documentation/DocBook as is in case of the Linux kernel.
Some parts of the DocBook Makefile are unused, but to allow easier sync with Linux kernel, these parts are still left in. The targets enabled now are "htmldocs" "pdfdocs" "psdocs" "xmldocs" and "cleandocs" to remove the results of documentation build.
Linux scripts/docproc.c:
commit f0f3ca8d967462dafb815412b14ca3339b9817a6
Date: Wed Jun 15 11:53:13 2011 +0200
Linux scripts/kernel-doc:
commit 1b40c1944db445c1de1c47ffd8cd426167f488e8
Date: Sun Aug 12 10:46:15 2012 +0200
Linux Documentation/DocBook:
commit bb8187d35f820671d6dd76700d77a6b55f95e2c5
Date: Thu May 17 19:06:13 2012 -0400
--- Makefile | 7 +- doc/DocBook/.gitignore | 15 + doc/DocBook/Makefile | 229 ++++ doc/DocBook/stylesheet.xsl | 10 + tools/.gitignore | 1 + tools/Makefile | 2 +- tools/kernel-doc/Makefile | 38 + tools/kernel-doc/docproc.c | 576 ++++++++++ tools/kernel-doc/kernel-doc | 2554 +++++++++++++++++++++++++++++++++++++++++++ 9 files changed, 3430 insertions(+), 2 deletions(-) create mode 100644 doc/DocBook/.gitignore create mode 100644 doc/DocBook/Makefile create mode 100644 doc/DocBook/stylesheet.xsl create mode 100644 tools/kernel-doc/Makefile create mode 100644 tools/kernel-doc/docproc.c create mode 100755 tools/kernel-doc/kernel-doc
Makefile +6 -1
@@ -695,6 +695,9 @@ easylogo env gdb: $(MAKE) -C tools/$@ all MTD_VERSION=${MTD_VERSION} gdbtools: gdb +xmldocs pdfdocs psdocs htmldocs mandocs: tools/kernel-doc/docproc + $(MAKE) U_BOOT_VERSION=$(U_BOOT_VERSION) -C doc/DocBook/ $@ + tools-all: easylogo env gdb $(VERSION_FILE) $(TIMESTAMP_FILE) $(MAKE) -C tools HOST_TOOLS_ALL=y
@@ -779,7 +782,8 @@ clean: $(obj)tools/mk{env,}image $(obj)tools/mpc86x_clk \ $(obj)tools/mk{smdk5250,}spl \ $(obj)tools/mxsboot \ - $(obj)tools/ncb $(obj)tools/ubsha1 + $(obj)tools/ncb $(obj)tools/ubsha1 \ + $(obj)tools/kernel-doc/docproc @rm -f $(obj)board/cray/L1/{bootscript.c,bootscript.image} \ $(obj)board/matrix_vision/*/bootscript.img \ $(obj)board/voiceblue/eeprom \
@@ -792,6 +796,7 @@ clean: @rm -f $(obj)include/generated/asm-offsets.h @rm -f $(obj)$(CPUDIR)/$(SOC)/asm-offsets.s @rm -f $(TIMESTAMP_FILE) $(VERSION_FILE) + @$(MAKE) -C doc/DocBook/ cleandocs @find $(OBJTREE) -type f \ \( -name 'core' -o -name '*.bak' -o -name '*~' -o -name '*.su' \ -o -name '*.o' -o -name '*.a' -o -name '*.exe' \) -print \
doc/DocBook/.gitignore new file +15 -0
@@ -0,0 +1,15 @@ +*/ +*.xml +*.ps +*.pdf +*.html +*.9.gz +*.9 +*.aux +*.dvi +*.log +*.out +*.png +*.gif +media-indices.tmpl +media-entities.tmpl
doc/DocBook/Makefile new file +229 -0
229 lines not on this page · raw message
doc/DocBook/stylesheet.xsl new file +10 -0
@@ -0,0 +1,10 @@ +<?xml version="1.0" encoding="UTF-8"?> +<stylesheet xmlns="http://www.w3.org/1999/XSL/Transform" version="1.0"> +<param name="chunk.quietly">1</param> +<param name="funcsynopsis.style">ansi</param> +<param name="funcsynopsis.tabular.threshold">80</param> +<param name="callout.graphics">0</param> +<!-- <param name="paper.type">A4</param> --> +<param name="generate.section.toc.level">2</param> +<param name="use.id.as.filename">1</param> +</stylesheet>
tools/.gitignore +1 -0
@@ -17,3 +17,4 @@ /env/fw_printenv /gdb/gdbcont /gdb/gdbsend +/kernel-doc/docproc
tools/Makefile +1 -1
@@ -21,7 +21,7 @@ # MA 02111-1307 USA # -TOOLSUBDIRS = +TOOLSUBDIRS = kernel-doc # # Include this after HOSTOS HOSTARCH check
tools/kernel-doc/Makefile new file +38 -0
@@ -0,0 +1,38 @@ +# +# Copyright (C) 2012 Marek Vasut <[email protected]> +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation; either version 2 of +# the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, +# MA 02111-1307 USA +# + +include $(TOPDIR)/config.mk + +all: $(obj)docproc + +$(obj)docproc: docproc.c + $(HOSTCC) $(HOSTCFLAGS) $(HOSTLDFLAGS) -o $@ $^ + $(HOSTSTRIP) $@ + +clean: + rm -rf docproc + +######################################################################### + +# defines $(obj).depend target +include $(SRCTREE)/rules.mk + +sinclude $(obj).depend + +#########################################################################
tools/kernel-doc/docproc.c new file +576 -0
576 lines not on this page · raw message
tools/kernel-doc/kernel-doc new file +2554 -0
2,095 lines not on this page · raw message
The rest of this diff is not shown. View the raw message.
Signature · 1 line
1.7.10.4
Part of the diff is not shown here. View the raw message.
PATCH 2/4 doc: kerneldoc: Add nicer CSS stylesheet for HTML docs
In reply to Marek VasutImport basic CSS stylesheet for the HTML documentation. The base for the stylesheet is taken from:
http://ds9a.nl/docbook/minimal-page.html
I customized the CSS a bit further, for example to add curvy corners to example section and change the tint of gray. The HTML documentation does not look that crude anymore.
--- doc/DocBook/docbook.css | 16 ++++++++++++++++ doc/DocBook/stylesheet.xsl | 1 + 2 files changed, 17 insertions(+) create mode 100644 doc/DocBook/docbook.css
doc/DocBook/docbook.css new file +16 -0
@@ -0,0 +1,16 @@ +body { + font-family: sans-serif; +} + +.programlisting { + font-family: monospace; + font-size: 1em; + display: block; + padding: 10px; + border: 1px solid #aaa; + color: #000; + background-color: #eee; + overflow: auto; + margin: 1em 0em; + border-radius: 6px; +}
doc/DocBook/stylesheet.xsl +1 -0
@@ -7,4 +7,5 @@ <!-- <param name="paper.type">A4</param> --> <param name="generate.section.toc.level">2</param> <param name="use.id.as.filename">1</param> +<param name="html.stylesheet">../docbook.css</param> </stylesheet>
Signature · 1 line
1.7.10.4
PATCH 3/4 doc: kerneldoc: Implement "Example" section handling
In reply to Marek VasutThe default kernel-doc strips starting spaces from every single line in the Example section. This makes the code look bad. Thus, implement special handling for this section.
--- tools/kernel-doc/kernel-doc | 3 +++ 1 file changed, 3 insertions(+)
tools/kernel-doc/kernel-doc +3 -0
@@ -2424,6 +2424,9 @@ sub process_file($) { # Continued declaration purpose chomp($declaration_purpose); $declaration_purpose .= " " . xml_escape($1); + } elsif ($section =~ m/^Example/) { + $_ =~ s/^\s*\*//; + $contents .= $_; } else { $contents .= $1 . "\n"; }
Signature · 1 line
1.7.10.4
PATCH 4/4 doc: kerneldoc: tmpl: Implement template for LG-arrays
In reply to Marek VasutImplement kerneldoc template for linker-generated arrays. This is the first template in U-Boot that is used to generate kerneldoc style documentation. This template is very basic.
--- doc/DocBook/Makefile | 2 +- doc/DocBook/linker_lists.tmpl | 46 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 47 insertions(+), 1 deletion(-) create mode 100644 doc/DocBook/linker_lists.tmpl
doc/DocBook/Makefile +1 -1
@@ -8,7 +8,7 @@ include $(TOPDIR)/config.mk -DOCBOOKS := +DOCBOOKS := linker_lists.xml ### # The build process is as follows (targets):
doc/DocBook/linker_lists.tmpl new file +46 -0
46 lines not on this page · raw message
Signature · 1 line
1.7.10.4
v2 cover Implant kernel-doc from Linux kernel
In reply to Marek VasutQuoted 14 lines · Marek Vasut
This patch series implants slightly modified kernel-doc documentation generator from Linux kernel into U-Boot. First patch pulls in all the necessary components with minor modifications made to them to work with the layout of U-Boot source tree and without kbuild.
Further patch implement CSS to make the HTML documentation look a bit nicer. This patch will eventually (hopefully) be further refined by someone more artistically capable than me ;-)
Next patch implements separate handling for "Example:" section, which in the original kernel-doc was in my opinion mistreated. The example section generated a block of code, but the indentation was removed. Thus this patch does avoid removing the indent.
Quoted 8 lines
Finally, the last patch implements example of how to use this kernel-doc to generate U-Boot documentation by documenting the Linker-Generated arrays.
NOTE: This patchset (last patch) has a cross-dependency on:
[PATCH 0/5] Linker-generated arrays (take 2)V2: Add proper .gitignore entries, fix build issues (fix Makefiles)
Thanks for doing all this. It looks fine and I'll grab this with the LG-arrays code once everyone is happy on that side.
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 836 bytes Desc: Digital signature URL: <http://lists.denx.de/pipermail/u-boot/attachments/20121002/286746ab/attachment.pgp>
v2 cover Implant kernel-doc from Linux kernel
Dear Tom Rini,
Quoted 19 lines · Marek Vasut
Quoted 18 lines
This patch series implants slightly modified kernel-doc documentation generator from Linux kernel into U-Boot. First patch pulls in all the necessary components with minor modifications made to them to work with the layout of U-Boot source tree and without kbuild.
Further patch implement CSS to make the HTML documentation look a bit nicer. This patch will eventually (hopefully) be further refined by someone more artistically capable than me ;-)
Next patch implements separate handling for "Example:" section, which in the original kernel-doc was in my opinion mistreated. The example section generated a block of code, but the indentation was removed. Thus this patch does avoid removing the indent.
Finally, the last patch implements example of how to use this kernel-doc to generate U-Boot documentation by documenting the Linker-Generated arrays.
Quoted 7 lines
Quoted 4 lines
NOTE: This patchset (last patch) has a cross-dependency on:
[PATCH 0/5] Linker-generated arrays (take 2)V2: Add proper .gitignore entries, fix build issues (fix Makefiles)
Thanks for doing all this. It looks fine and I'll grab this with the LG-arrays code once everyone is happy on that side.
I'm spliting the LG-array dep from these ... but I have another problem. If I actually add the patman tags here (which I did now), can you pull that repo without pulling the tags too? How do we handle that ?
Best regards,
Marek Vasut
v2 cover Implant kernel-doc from Linux kernel
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Quoted 30 lines · Marek Vasut
Dear Tom Rini,
Quoted 28 lines · Marek Vasut
Quoted 26 lines
This patch series implants slightly modified kernel-doc documentation generator from Linux kernel into U-Boot. First patch pulls in all the necessary components with minor modifications made to them to work with the layout of U-Boot source tree and without kbuild.
Further patch implement CSS to make the HTML documentation look a bit nicer. This patch will eventually (hopefully) be further refined by someone more artistically capable than me ;-)
Next patch implements separate handling for "Example:" section, which in the original kernel-doc was in my opinion mistreated. The example section generated a block of code, but the indentation was removed. Thus this patch does avoid removing the indent.
Finally, the last patch implements example of how to use this kernel-doc to generate U-Boot documentation by documenting the Linker-Generated arrays.
NOTE: This patchset (last patch) has a cross-dependency on:
[PATCH 0/5] Linker-generated arrays (take 2)V2: Add proper .gitignore entries, fix build issues (fix Makefiles)
Quoted 7 lines
Quoted 2 lines
Thanks for doing all this. It looks fine and I'll grab this with the LG-arrays code once everyone is happy on that side.
I'm spliting the LG-array dep from these ... but I have another problem. If I actually add the patman tags here (which I did now), can you pull that repo without pulling the tags too? How do we handle that ?
We talked about this on IRC, but to be clear and for the record:
- - No pull requests from patman branches
- - Just do a 'git checkout -b final/feature base_branch' or whatever and then just 'git am 0*' the patches that patman will have spit out for you already.
- --
Tom
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://www.enigmail.net/
iQIcBAEBAgAGBQJQcvOEAAoJENk4IS6UOR1WCeMQAIMQwHlea3YRYF7lqoXuQVI3 xyrDV+c502TWh+uHUMUHjzYo7StGmOhzC/0WOkjn9hCB2bT1uzHqYWOJ2e8Hl7gG eHiWLJrYIq6+s7sZh8lKORiQY4AVyqMzuYNz6xmdWAw8s1N9T3tEN9Mw1AfNXy/G tL6E+UXo47zHjVzunWa3opaiUVx7C4ofWrQ1zsqPnY+IaVUX4NdCeVJt6vQLNKOD iCXm5eCqD8J+eEGxLh9jgekZXC2pnb11GJeMB0tOZPkYrLU6o3kdNlqW6WGUgXJb cV0bwIvJJhqTH1j1asd1b8t5dfMK0qlVVmI/FzgWc0ADwJqlGXKUWng5EoERaYN1 dxM+E8NwP+78VLCtZJKH+g5RkczSm5ZuDkxgrAbIZAajclxrEUN+IZp5zv4iG7iF kWjNiGYWXAE+0GpVJEFH2iVi1sTmvJCYcFspsyP+SSJWEq71Xoe/4YXyEYYCg/Wa ffv557zo4lF+fh4DCjUBOrk1XzBOZP2cMHT272+gQ4bYLHFJqKypSaqS+en+hHAZ dheb6tLYbzavE8mNN4cX6LQeRgwfjArf5DaqRJqnwAkma2pfM7fLw6wqSUrVGPBf alM1dA59h2Tnv6pg7BiQSRGCvyyk29C3KZAJSNECCPCvrVO4X1/+kaASVGfZ81bY cGmT10suFww/Y4C2O1GF
=7f2b
-----END PGP SIGNATURE-----
v2 cover Implant kernel-doc from Linux kernel
Dear Tom Rini,
Quoted 39 lines · Marek Vasut
Quoted 30 lines
Dear Tom Rini,
Quoted 28 lines · Marek Vasut
Quoted 26 lines
This patch series implants slightly modified kernel-doc documentation generator from Linux kernel into U-Boot. First patch pulls in all the necessary components with minor modifications made to them to work with the layout of U-Boot source tree and without kbuild.
Further patch implement CSS to make the HTML documentation look a bit nicer. This patch will eventually (hopefully) be further refined by someone more artistically capable than me ;-)
Next patch implements separate handling for "Example:" section, which in the original kernel-doc was in my opinion mistreated. The example section generated a block of code, but the indentation was removed. Thus this patch does avoid removing the indent.
Finally, the last patch implements example of how to use this kernel-doc to generate U-Boot documentation by documenting the Linker-Generated arrays.
NOTE: This patchset (last patch) has a cross-dependency on:
[PATCH 0/5] Linker-generated arrays (take 2)V2: Add proper .gitignore entries, fix build issues (fix Makefiles)
Quoted 7 lines
Quoted 2 lines
Thanks for doing all this. It looks fine and I'll grab this with the LG-arrays code once everyone is happy on that side.
I'm spliting the LG-array dep from these ... but I have another problem. If I actually add the patman tags here (which I did now), can you pull that repo without pulling the tags too? How do we handle that ?
Quoted 5 lines
We talked about this on IRC, but to be clear and for the record:
- No pull requests from patman branches
- Just do a 'git checkout -b final/featurebase_branch' or whatever and then just 'git am 0*' the patches that patman will have spit out for you already.
Yes, good. I rolled out V3, are we ok to apply? I have some patches for upstream linux kernel ready, but ... documentation seems to be pretty dead/deaf area there :(
Best regards,
Marek Vasut
v2 cover Implant kernel-doc from Linux kernel
In reply to Marek VasutQuoted 14 lines · Marek Vasut
This patch series implants slightly modified kernel-doc documentation generator from Linux kernel into U-Boot. First patch pulls in all the necessary components with minor modifications made to them to work with the layout of U-Boot source tree and without kbuild.
Further patch implement CSS to make the HTML documentation look a bit nicer. This patch will eventually (hopefully) be further refined by someone more artistically capable than me ;-)
Next patch implements separate handling for "Example:" section, which in the original kernel-doc was in my opinion mistreated. The example section generated a block of code, but the indentation was removed. Thus this patch does avoid removing the indent.
Quoted 8 lines
Finally, the last patch implements example of how to use this kernel-doc to generate U-Boot documentation by documenting the Linker-Generated arrays.
NOTE: This patchset (last patch) has a cross-dependency on:
[PATCH 0/5] Linker-generated arrays (take 2)V2: Add proper .gitignore entries, fix build issues (fix Makefiles)
Applied to u-boot/next, thanks!
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 836 bytes Desc: Digital signature URL: <http://lists.denx.de/pipermail/u-boot/attachments/20121009/a5b2f828/attachment.pgp>
v2 cover Implant kernel-doc from Linux kernel
Dear Tom Rini,
Quoted 19 lines · Marek Vasut
Quoted 18 lines
This patch series implants slightly modified kernel-doc documentation generator from Linux kernel into U-Boot. First patch pulls in all the necessary components with minor modifications made to them to work with the layout of U-Boot source tree and without kbuild.
Further patch implement CSS to make the HTML documentation look a bit nicer. This patch will eventually (hopefully) be further refined by someone more artistically capable than me ;-)
Next patch implements separate handling for "Example:" section, which in the original kernel-doc was in my opinion mistreated. The example section generated a block of code, but the indentation was removed. Thus this patch does avoid removing the indent.
Finally, the last patch implements example of how to use this kernel-doc to generate U-Boot documentation by documenting the Linker-Generated arrays.
Quoted 6 lines
Quoted 4 lines
NOTE: This patchset (last patch) has a cross-dependency on:
[PATCH 0/5] Linker-generated arrays (take 2)V2: Add proper .gitignore entries, fix build issues (fix Makefiles)
Applied to u-boot/next, thanks!
Good, now it is imperative to discuss the rules. Can you check my proposal for wiki addendum?
Best regards,
Marek Vasut
v2 cover Implant kernel-doc from Linux kernel
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Quoted 27 lines · Marek Vasut
Dear Tom Rini,
Quoted 25 lines · Marek Vasut
Quoted 24 lines
This patch series implants slightly modified kernel-doc documentation generator from Linux kernel into U-Boot. First patch pulls in all the necessary components with minor modifications made to them to work with the layout of U-Boot source tree and without kbuild.
Further patch implement CSS to make the HTML documentation look a bit nicer. This patch will eventually (hopefully) be further refined by someone more artistically capable than me ;-)
Next patch implements separate handling for "Example:" section, which in the original kernel-doc was in my opinion mistreated. The example section generated a block of code, but the indentation was removed. Thus this patch does avoid removing the indent.
Finally, the last patch implements example of how to use this kernel-doc to generate U-Boot documentation by documenting the Linker-Generated arrays.
NOTE: This patchset (last patch) has a cross-dependency on:
[PATCH 0/5] Linker-generated arrays (take 2)
Quoted 7 lines
Quoted 4 lines
Quoted 2 lines
V2: Add proper .gitignore entries, fix build issues (fix Makefiles)
Applied to u-boot/next, thanks!
Good, now it is imperative to discuss the rules. Can you check my proposal for wiki addendum?
Done, and for clarity I did apply the v3 series, not v2. Just replied to the wrong summary.
- --
Tom
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://www.enigmail.net/
iQIcBAEBAgAGBQJQdKpcAAoJENk4IS6UOR1WefEP/02YKDZmHMOydwCCmvQchCXY +eaNjr+Ivp7D8q2IRNoXjNocPJJqwWP3OtOrjWkqMumFSXz8skbzHv88dtMEWEWr V+2haSSLAv7+bcaNzKtNVokvifHOPv9BGKQ9reujFc3/K1qJvznqflORxj8pzMJb IoyudOywLZpZnFE4C+TcoRlTlGZQyKiDka/fgAuW0B40+PU9E4XVrlWVuKW19jx2 h1vISn9/tzxMjzQNaDMt5q6gLXXQHxmx935BOdOvK6oy/et9fWiL/c+pjCCpOWSt MOgrS3m//NI7l//mqK+v1HXRskAo0FOfQVDdXlIYZfrsy87der+6+51hq5ZBmZG3 ZeQX4hsX49iPNQUAL5oqgKzrT2DOcAfPYcO7Stvc5yDuMwcP5TZr4lM/byPsRt9t t3A0FD9d1KHsUIXq9aoaagTOEGTIvIxafUsEpj2TeNx5hEkNJ+QvcR9kNOQPl7/5 Pw0MeG0lc/uCPoWfh+0l8aZQK62Nv73xPFhTjFjxuqyExkKZV+sblnTLxoHAK58n iomFJuGEPkqfFxl8vciMSw4HtHljoiE7tPR/LQhUW0GLx/GPr17gFCrj8CGIRbcE XXSzaZidubTldZHhLasvwcWq3dAdNS9rue39xk5LBDCMdnfBGrrOT+ET9RL9tw4m aEULcH1AagfrnoB6fYLf
=K7hF
-----END PGP SIGNATURE-----
PATCH v3 1/4 kerneldoc: Implant DocBook from Linux kernel
In reply to Marek VasutPull slightly modified version of Documentation/DocBook, the related perl script scripts/kernel-doc and the scripts/docproc.c from Linux kernel and implant it into U-Boot. This will allow smooth generation of kerneldoc style documentation.
It was necessary to modify the DocBook/Makefile to work with U-Boot build system. The changes were only minor though and involved replacing the kbuild specific parts.
It was also necessary to replace use of variables like KERNEL_VERSION with U_BOOT_VERSION, strings like Linux kernel with U-Boot Bootloader etc. so the generated result actually matches.
Finally, it was necessary to adjust docproc.c, since the documentation in U-Boot is located in doc/DocBook instead of Documentation/DocBook as is in case of the Linux kernel.
Some parts of the DocBook Makefile are unused, but to allow easier sync with Linux kernel, these parts are still left in. The targets enabled now are "htmldocs" "pdfdocs" "psdocs" "xmldocs" and "cleandocs" to remove the results of documentation build.
Linux scripts/docproc.c:
commit f0f3ca8d967462dafb815412b14ca3339b9817a6
Date: Wed Jun 15 11:53:13 2011 +0200
Linux scripts/kernel-doc:
commit 1b40c1944db445c1de1c47ffd8cd426167f488e8
Date: Sun Aug 12 10:46:15 2012 +0200
Linux Documentation/DocBook:
commit bb8187d35f820671d6dd76700d77a6b55f95e2c5
Date: Thu May 17 19:06:13 2012 -0400
--- Makefile | 7 +- doc/DocBook/.gitignore | 15 + doc/DocBook/Makefile | 229 ++++ doc/DocBook/stylesheet.xsl | 10 + tools/.gitignore | 1 + tools/Makefile | 2 +- tools/kernel-doc/Makefile | 38 + tools/kernel-doc/docproc.c | 576 ++++++++++ tools/kernel-doc/kernel-doc | 2554 +++++++++++++++++++++++++++++++++++++++++++ 9 files changed, 3430 insertions(+), 2 deletions(-) create mode 100644 doc/DocBook/.gitignore create mode 100644 doc/DocBook/Makefile create mode 100644 doc/DocBook/stylesheet.xsl create mode 100644 tools/kernel-doc/Makefile create mode 100644 tools/kernel-doc/docproc.c create mode 100755 tools/kernel-doc/kernel-doc
V3:
- Discard the patch adding LG-array template
- Add patch adding myself into git aliases for kerneldoc
- Make use of patman tags in commit description
- Push the patches to testing:
http://git.denx.de/?p=u-boot/u-boot-testing.git;a=shortlog;h=refs/heads/dm-kerneldoc
V2:
- Add .gitignore, drop kernel-doc target which was bogus
Makefile +6 -1
@@ -695,6 +695,9 @@ easylogo env gdb: $(MAKE) -C tools/$@ all MTD_VERSION=${MTD_VERSION} gdbtools: gdb +xmldocs pdfdocs psdocs htmldocs mandocs: tools/kernel-doc/docproc + $(MAKE) U_BOOT_VERSION=$(U_BOOT_VERSION) -C doc/DocBook/ $@ + tools-all: easylogo env gdb $(VERSION_FILE) $(TIMESTAMP_FILE) $(MAKE) -C tools HOST_TOOLS_ALL=y
@@ -779,7 +782,8 @@ clean: $(obj)tools/mk{env,}image $(obj)tools/mpc86x_clk \ $(obj)tools/mk{smdk5250,}spl \ $(obj)tools/mxsboot \ - $(obj)tools/ncb $(obj)tools/ubsha1 + $(obj)tools/ncb $(obj)tools/ubsha1 \ + $(obj)tools/kernel-doc/docproc @rm -f $(obj)board/cray/L1/{bootscript.c,bootscript.image} \ $(obj)board/matrix_vision/*/bootscript.img \ $(obj)board/voiceblue/eeprom \
@@ -792,6 +796,7 @@ clean: @rm -f $(obj)include/generated/asm-offsets.h @rm -f $(obj)$(CPUDIR)/$(SOC)/asm-offsets.s @rm -f $(TIMESTAMP_FILE) $(VERSION_FILE) + @$(MAKE) -C doc/DocBook/ cleandocs @find $(OBJTREE) -type f \ \( -name 'core' -o -name '*.bak' -o -name '*~' -o -name '*.su' \ -o -name '*.o' -o -name '*.a' -o -name '*.exe' \) -print \
doc/DocBook/.gitignore new file +15 -0
@@ -0,0 +1,15 @@ +*/ +*.xml +*.ps +*.pdf +*.html +*.9.gz +*.9 +*.aux +*.dvi +*.log +*.out +*.png +*.gif +media-indices.tmpl +media-entities.tmpl
doc/DocBook/Makefile new file +229 -0
229 lines not on this page · raw message
doc/DocBook/stylesheet.xsl new file +10 -0
@@ -0,0 +1,10 @@ +<?xml version="1.0" encoding="UTF-8"?> +<stylesheet xmlns="http://www.w3.org/1999/XSL/Transform" version="1.0"> +<param name="chunk.quietly">1</param> +<param name="funcsynopsis.style">ansi</param> +<param name="funcsynopsis.tabular.threshold">80</param> +<param name="callout.graphics">0</param> +<!-- <param name="paper.type">A4</param> --> +<param name="generate.section.toc.level">2</param> +<param name="use.id.as.filename">1</param> +</stylesheet>
tools/.gitignore +1 -0
@@ -17,3 +17,4 @@ /env/fw_printenv /gdb/gdbcont /gdb/gdbsend +/kernel-doc/docproc
tools/Makefile +1 -1
@@ -21,7 +21,7 @@ # MA 02111-1307 USA # -TOOLSUBDIRS = +TOOLSUBDIRS = kernel-doc # # Include this after HOSTOS HOSTARCH check
tools/kernel-doc/Makefile new file +38 -0
@@ -0,0 +1,38 @@ +# +# Copyright (C) 2012 Marek Vasut <[email protected]> +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation; either version 2 of +# the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, +# MA 02111-1307 USA +# + +include $(TOPDIR)/config.mk + +all: $(obj)docproc + +$(obj)docproc: docproc.c + $(HOSTCC) $(HOSTCFLAGS) $(HOSTLDFLAGS) -o $@ $^ + $(HOSTSTRIP) $@ + +clean: + rm -rf docproc + +######################################################################### + +# defines $(obj).depend target +include $(SRCTREE)/rules.mk + +sinclude $(obj).depend + +#########################################################################
tools/kernel-doc/docproc.c new file +576 -0
576 lines not on this page · raw message
tools/kernel-doc/kernel-doc new file +2554 -0
2,095 lines not on this page · raw message
The rest of this diff is not shown. View the raw message.
Signature · 1 line
1.7.10.4
Part of the diff is not shown here. View the raw message.
PATCH v3 2/4 kerneldoc: Add nicer CSS stylesheet for HTML docs
Import basic CSS stylesheet for the HTML documentation. The base for the stylesheet is taken from:
http://ds9a.nl/docbook/minimal-page.html
I customized the CSS a bit further, for example to add curvy corners to example section and change the tint of gray. The HTML documentation does not look that crude anymore.
--- doc/DocBook/docbook.css | 16 ++++++++++++++++ doc/DocBook/stylesheet.xsl | 1 + 2 files changed, 17 insertions(+) create mode 100644 doc/DocBook/docbook.css
V3:
- Make use of patman tags in commit description
- Push the patches to testing:
http://git.denx.de/?p=u-boot/u-boot-testing.git;a=shortlog;h=refs/heads/dm-kerneldoc
V2:
- Resend
doc/DocBook/docbook.css new file +16 -0
@@ -0,0 +1,16 @@ +body { + font-family: sans-serif; +} + +.programlisting { + font-family: monospace; + font-size: 1em; + display: block; + padding: 10px; + border: 1px solid #aaa; + color: #000; + background-color: #eee; + overflow: auto; + margin: 1em 0em; + border-radius: 6px; +}
doc/DocBook/stylesheet.xsl +1 -0
@@ -7,4 +7,5 @@ <!-- <param name="paper.type">A4</param> --> <param name="generate.section.toc.level">2</param> <param name="use.id.as.filename">1</param> +<param name="html.stylesheet">../docbook.css</param> </stylesheet>
Signature · 1 line
1.7.10.4
PATCH v3 3/4 kerneldoc: Implement "Example" section handling
In reply to Marek VasutThe default kernel-doc strips starting spaces from every single line in the Example section. This makes the code look bad. Thus, implement special handling for this section.
--- tools/kernel-doc/kernel-doc | 3 +++ 1 file changed, 3 insertions(+)
V3:
- Make use of patman tags in commit description
- Push the patches to testing:
http://git.denx.de/?p=u-boot/u-boot-testing.git;a=shortlog;h=refs/heads/dm-kerneldoc
V2:
- Resend
tools/kernel-doc/kernel-doc +3 -0
@@ -2424,6 +2424,9 @@ sub process_file($) { # Continued declaration purpose chomp($declaration_purpose); $declaration_purpose .= " " . xml_escape($1); + } elsif ($section =~ m/^Example/) { + $_ =~ s/^\s*\*//; + $contents .= $_; } else { $contents .= $1 . "\n"; }
Signature · 1 line
1.7.10.4
PATCH v3 4/4 kerneldoc: Add myself to the git-mailrc for kerneldoc
In reply to Marek VasutAdd entry for kerneldoc into the git-mailrc pointing to the U-Boot ML and myself.
--- doc/git-mailrc | 1 + 1 file changed, 1 insertion(+)
V3:
- New patch
- Make use of patman tags in commit description
- Push the patches to testing:
http://git.denx.de/?p=u-boot/u-boot-testing.git;a=shortlog;h=refs/heads/dm-kerneldoc
doc/git-mailrc +1 -0
@@ -95,6 +95,7 @@ alias x86 uboot, gruss # Subsystem aliases alias cfi uboot, stroese +alias kerneldoc uboot, marex alias fdt uboot, Jerry Van Baren <[email protected]> alias i2c uboot, hs alias mmc uboot, afleming
Signature · 1 line
1.7.10.4
PATCH v3 1/4 kerneldoc: Implant DocBook from Linux kernel
In reply to Marek VasutQuoted 30 lines · Marek Vasut
Pull slightly modified version of
Documentation/DocBook, the related perl scriptscripts/kernel-docand thescripts/docproc.cfrom Linux kernel and implant it into U-Boot. This will allow smooth generation of kerneldoc style documentation.It was necessary to modify the DocBook/Makefile to work with U-Boot build system. The changes were only minor though and involved replacing the kbuild specific parts.
It was also necessary to replace use of variables like
KERNEL_VERSIONwithU_BOOT_VERSION, strings like Linux kernel with U-Boot Bootloader etc. so the generated result actually matches.Finally, it was necessary to adjust
docproc.c, since the documentation in U-Boot is located in doc/DocBook instead ofDocumentation/DocBookas is in case of the Linux kernel.Some parts of the DocBook
Makefileare unused, but to allow easier sync with Linux kernel, these parts are still left in. The targets enabled now are "htmldocs" "pdfdocs" "psdocs" "xmldocs" and "cleandocs" to remove the results of documentation build.Linux
scripts/docproc.c:
commitf0f3ca8d967462dafb815412b14ca3339b9817a6
Date: Wed Jun 15 11:53:13 2011 +0200Linux
scripts/kernel-doc:
commit1b40c1944db445c1de1c47ffd8cd426167f488e8
Date: Sun Aug 12 10:46:15 2012 +0200
Quoted 6 lines
Linux
Documentation/DocBook:
commitbb8187d35f820671d6dd76700d77a6b55f95e2c5
Date: Thu May 17 19:06:13 2012 -0400Signed-off-by Marek Vasut <[email protected]>---
This patch makes it so that MAKEALL doesn't build silently anymore:
make[1]: Entering directory /local/afleming/u-boot/doc/DocBook' make[1]: Leaving directory /local/afleming/u-boot/doc/DocBook'
Any ideas how we can fix that?
PATCH v3 1/4 kerneldoc: Implant DocBook from Linux kernel
Dear Andy Fleming,
[...]
Quoted 8 lines
This patch makes it so that MAKEALL doesn't build silently anymore:
make[1]: Entering directory
/local/afleming/u-boot/doc/DocBook' make[1]: Leaving directory/local/afleming/u-boot/doc/DocBook'Any ideas how we can fix that?
I thought this was fixed, where do you see it?
$ BUILD_DIR=/tmp/test ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- ./MAKEALL m28evk Configuring for m28evk board... text data bss dec hex filename 424579 7784 288876 721239 b0157 /tmp/test/u-boot 6984 760 0 7744 1e40 /tmp/test/spl/u-boot-spl
--------------------- SUMMARY ---------------------------- Boards compiled: 1
----------------------------------------------------------
Best regards,
Marek Vasut
PATCH v3 1/4 kerneldoc: Implant DocBook from Linux kernel
Quoted 13 lines · Marek Vasut
Dear Andy Fleming,
[...]
Quoted 8 lines
This patch makes it so that MAKEALL doesn't build silently anymore:
make[1]: Entering directory
/local/afleming/u-boot/doc/DocBook' make[1]: Leaving directory/local/afleming/u-boot/doc/DocBook'Any ideas how we can fix that?
Quoted 7 lines
I thought this was fixed, where do you see it?
$ BUILD_DIR=/tmp/test ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- ./MAKEALL m28evk Configuring for m28evk board... text data bss dec hex filename 424579 7784 288876 721239 b0157 /tmp/test/u-boot 6984 760 0 7744 1e40 /tmp/test/spl/u-boot-spl
Hmm, with the latest tree I get:
[afleming at right u-boot (master)]$ ./MAKEALL P2020RDB_NAND Configuring for P2020RDB_NAND - Board: P1_P2_RDB, Options: P2020RDB,NAND make[1]: Entering directory /local/afleming/u-boot/doc/DocBook' make[1]: Leaving directory /local/afleming/u-boot/doc/DocBook'
text data bss dec hex filename
399394 16752 267792 683938 a6fa2 ./build/P2020RDB_NAND/u-boot
PATCH v3 1/4 kerneldoc: Implant DocBook from Linux kernel
Quoted 23 lines · Andy Fleming
Quoted 13 lines · Marek Vasut
Dear Andy Fleming,
[...]
Quoted 8 lines
This patch makes it so that MAKEALL doesn't build silently anymore:
make[1]: Entering directory
/local/afleming/u-boot/doc/DocBook' make[1]: Leaving directory/local/afleming/u-boot/doc/DocBook'Any ideas how we can fix that?
Quoted 7 lines
I thought this was fixed, where do you see it?
$ BUILD_DIR=/tmp/test ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- ./MAKEALL m28evk Configuring for m28evk board... text data bss dec hex filename 424579 7784 288876 721239 b0157 /tmp/test/u-boot 6984 760 0 7744 1e40 /tmp/test/spl/u-boot-spl
Quoted 8 lines
Hmm, with the latest tree I get:
[afleming at right u-boot (master)]$ ./MAKEALL
P2020RDB_NANDConfiguring forP2020RDB_NAND- Board:P1_P2_RDB, Options: P2020RDB,NAND make[1]: Entering directory/local/afleming/u-boot/doc/DocBook' make[1]: Leaving directory/local/afleming/u-boot/doc/DocBook'
text data bss dec hex filename
399394 16752 267792 683938 a6fa2 ./build/P2020RDB_NAND/u-boot
make --version ?
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 836 bytes Desc: Digital signature URL: <http://lists.denx.de/pipermail/u-boot/attachments/20121023/e593e3d6/attachment.pgp>
PATCH v3 1/4 kerneldoc: Implant DocBook from Linux kernel
Quoted 26 lines · Tom Rini
Quoted 25 lines · Andy Fleming
Quoted 13 lines · Marek Vasut
Dear Andy Fleming,
[...]
Quoted 8 lines
This patch makes it so that MAKEALL doesn't build silently anymore:
make[1]: Entering directory
/local/afleming/u-boot/doc/DocBook' make[1]: Leaving directory/local/afleming/u-boot/doc/DocBook'Any ideas how we can fix that?
Quoted 7 lines
I thought this was fixed, where do you see it?
$ BUILD_DIR=/tmp/test ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- ./MAKEALL m28evk Configuring for m28evk board... text data bss dec hex filename 424579 7784 288876 721239 b0157 /tmp/test/u-boot 6984 760 0 7744 1e40 /tmp/test/spl/u-boot-splHmm, with the latest tree I get:
Quoted 8 lines
Quoted 6 lines
[afleming at right u-boot (master)]$ ./MAKEALL
P2020RDB_NANDConfiguring forP2020RDB_NAND- Board:P1_P2_RDB, Options: P2020RDB,NAND make[1]: Entering directory/local/afleming/u-boot/doc/DocBook' make[1]: Leaving directory/local/afleming/u-boot/doc/DocBook'
text data bss dec hex filename
399394 16752 267792 683938 a6fa2 ./build/P2020RDB_NAND/u-bootmake --version ?
GNU Make 3.81
This program built for x86_64-redhat-linux-gnu
PATCH v3 1/4 kerneldoc: Implant DocBook from Linux kernel
Quoted 34 lines · Andy Fleming
Quoted 33 lines · Tom Rini
Quoted 31 lines · Andy Fleming
Quoted 13 lines · Marek Vasut
Dear Andy Fleming,
[...]
Quoted 8 lines
This patch makes it so that MAKEALL doesn't build silently anymore:
make[1]: Entering directory
/local/afleming/u-boot/doc/DocBook' make[1]: Leaving directory/local/afleming/u-boot/doc/DocBook'Any ideas how we can fix that?
Quoted 7 lines
I thought this was fixed, where do you see it?
$ BUILD_DIR=/tmp/test ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- ./MAKEALL m28evk Configuring for m28evk board... text data bss dec hex filename 424579 7784 288876 721239 b0157 /tmp/test/u-boot 6984 760 0 7744 1e40 /tmp/test/spl/u-boot-splHmm, with the latest tree I get:
[afleming at right u-boot (master)]$ ./MAKEALL
P2020RDB_NANDConfiguring forP2020RDB_NAND- Board:P1_P2_RDB, Options: P2020RDB,NAND make[1]: Entering directory/local/afleming/u-boot/doc/DocBook' make[1]: Leaving directory/local/afleming/u-boot/doc/DocBook'
text data bss dec hex filename
399394 16752 267792 683938 a6fa2 ./build/P2020RDB_NAND/u-boot
Quoted 3 lines
Quoted 1 line
make --version ?
GNU Make 3.81
OK, found it, posting a patch now.
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 836 bytes Desc: Digital signature URL: <http://lists.denx.de/pipermail/u-boot/attachments/20121025/816d4a8d/attachment.pgp>
PATCH v3 1/4 kerneldoc: Implant DocBook from Linux kernel
Dear Tom Rini,
[...]
Quoted 5 lines
Quoted 3 lines
Quoted 1 line
make --version ?
GNU Make 3.81
OK, found it, posting a patch now.
What exactly did you find? I don't see this problem with make 3.81 .
Best regards,
Marek Vasut