@ -26,6 +26,7 @@ PS_METHOD = $(prefer-db2x)
# The targets that may be used.
# The targets that may be used.
PHONY += xmldocs sgmldocs psdocs pdfdocs htmldocs mandocs installmandocs cleandocs
PHONY += xmldocs sgmldocs psdocs pdfdocs htmldocs mandocs installmandocs cleandocs
targets += $( DOCBOOKS)
BOOKS := $( addprefix $( obj) /,$( DOCBOOKS) )
BOOKS := $( addprefix $( obj) /,$( DOCBOOKS) )
xmldocs : $( BOOKS )
xmldocs : $( BOOKS )
sgmldocs : xmldocs
sgmldocs : xmldocs
@ -44,17 +45,18 @@ htmldocs: $(HTML)
MAN := $( patsubst %.xml, %.9, $( BOOKS) )
MAN := $( patsubst %.xml, %.9, $( BOOKS) )
mandocs : $( MAN )
mandocs : $( MAN )
$( if $( wildcard $( obj) /man/*.9) ,gzip -f $( obj) /man/*.9)
installmandocs : mandocs
installmandocs : mandocs
mkdir -p /usr/local/man/man9/
mkdir -p /usr/local/man/man9/
install doc/DocBook /man/*.9.gz /usr/local/man/man9/
install $( obj) /man/*.9.gz /usr/local/man/man9/
###
###
#External programs used
#External programs used
KERNELDOC = $( srctree) /scripts/kernel-doc
KERNELDOC = $( srctree) /scripts/kernel-doc
DOCPROC = $( objtree) /scripts/docproc
DOCPROC = $( objtree) /scripts/docproc
XMLTOFLAGS = -m $( srctree) /doc/DocBook /stylesheet.xsl
XMLTOFLAGS = -m $( srctree) /$( src) /stylesheet.xsl
XMLTOFLAGS += --skip-validation
XMLTOFLAGS += --skip-validation
###
###
@ -76,21 +78,9 @@ define rule_docproc
) > $( dir $@ ) .$( notdir $@ ) .cmd
) > $( dir $@ ) .$( notdir $@ ) .cmd
e n d e f
e n d e f
%.xml : %.tmpl FORCE
%.xml : %.tmpl $( KERNELDOC ) $( DOCPROC ) FORCE
$( call if_changed_rule,docproc)
$( call if_changed_rule,docproc)
###
#Read in all saved dependency files
cmd_files := $( wildcard $( foreach f,$( BOOKS) ,$( dir $( f) ) .$( notdir $( f) ) .cmd) )
i f n e q ( $( cmd_files ) , )
include $( cmd_files)
e n d i f
###
# Changes in kernel-doc force a rebuild of all documentation
$(BOOKS) : $( KERNELDOC )
# Tell kbuild to always build the programs
# Tell kbuild to always build the programs
always := $( hostprogs-y)
always := $( hostprogs-y)
@ -128,16 +118,16 @@ quiet_cmd_db2pdf = PDF $@
index = index.html
index = index.html
main_idx = doc/DocBook /$( index)
main_idx = $( obj) /$( index)
build_main_index = rm -rf $( main_idx) ; \
build_main_index = rm -rf $( main_idx) ; \
echo '<h1>U-Boot Bootloader HTML Documentation</h1>' >> $( main_idx) && \
echo '<h1>U-Boot Bootloader HTML Documentation</h1>' >> $( main_idx) && \
echo '<h2>U-Boot Version: $(UBOOTVERSION)</h2>' >> $( main_idx) && \
echo '<h2>U-Boot Version: $(UBOOTVERSION)</h2>' >> $( main_idx) && \
cat $( HTML) >> $( main_idx)
cat $( HTML) >> $( main_idx)
quiet_cmd_db2html = HTML $@
quiet_cmd_db2html = HTML $@
cmd_db2html = xmlto x html $( XMLTOFLAGS) -o $( patsubst %.html,%,$@ ) $< && \
cmd_db2html = xmlto html $( XMLTOFLAGS) -o $( patsubst %.html,%,$@ ) $< && \
echo ' <a HREF = " $( patsubst %.html,%,$( notdir $@ ) ) /index.html " > \
echo ' <a HREF = " $( patsubst %.html,%,$( notdir $@ ) ) /index.html " > \
$( patsubst %.html,%,$( notdir $@ ) ) </a><p>' > $@
$( patsubst %.html,%,$( notdir $@ ) ) </a><p>' > $@
%.html : %.xml
%.html : %.xml
@( which xmlto > /dev/null 2>& 1) || \
@( which xmlto > /dev/null 2>& 1) || \
@ -149,7 +139,7 @@ quiet_cmd_db2html = HTML $@
cp $( PNG-$( basename $( notdir $@ ) ) ) $( patsubst %.html,%,$@ ) ; fi
cp $( PNG-$( basename $( notdir $@ ) ) ) $( patsubst %.html,%,$@ ) ; fi
quiet_cmd_db2man = MAN $@
quiet_cmd_db2man = MAN $@
cmd_db2man = if grep -q refentry $<; then xmlto man $( XMLTOFLAGS) -o $( obj) /man $< ; gzip -f $( obj) /man/*.9; fi
cmd_db2man = if grep -q refentry $<; then xmlto man $( XMLTOFLAGS) -o $( obj) /man $< ; fi
%.9 : %.xml
%.9 : %.xml
@( which xmlto > /dev/null 2>& 1) || \
@( which xmlto > /dev/null 2>& 1) || \
( echo "*** You need to install xmlto ***" ; \
( echo "*** You need to install xmlto ***" ; \