【已解决】docbook的makefile中实现发现sub level的makefile出错则顶层makefile停止编译且退出

【背景】

之前的:

E:\Dev_Root\docbook\dev\books\Makefile

还是有问题:

之前

make clean

时,没有删除掉,有问题的:

E:\Dev_Root\docbook\dev\books\soft_dev_basic\output\fo\soft_dev_basic.fo

导致后续

make release_copy

时,对于soft_dev_basic编译出错:

        at org.apache.fop.render.intermediate.AbstractIFPainter.drawImageUsingImageHandler(AbstractIFPainter.java:143)
        at org.apache.fop.render.intermediate.AbstractIFPainter.drawImageUsingURI(AbstractIFPainter.java:270)
        at org.apache.fop.render.pdf.PDFPainter.drawImage(PDFPainter.java:146)
        at org.apache.fop.render.intermediate.IFRenderer.drawImage(IFRenderer.java:1171)
        at org.apache.fop.render.intermediate.IFRenderer.renderImage(IFRenderer.java:1158)
        at org.apache.fop.render.AbstractRenderer.renderViewport(AbstractRenderer.java:741)
        at org.apache.fop.render.AbstractPathOrientedRenderer.renderViewport(AbstractPathOrientedRenderer.java:709)
        at org.apache.fop.render.intermediate.IFRenderer.renderViewport(IFRenderer.java:860)
        at org.apache.fop.render.AbstractRenderer.renderInlineArea(AbstractRenderer.java:634)
        at org.apache.fop.render.intermediate.IFRenderer.renderInlineArea(IFRenderer.java:912)
        at org.apache.fop.render.AbstractRenderer.renderLineArea(AbstractRenderer.java:609)
        at org.apache.fop.render.AbstractRenderer.renderBlocks(AbstractRenderer.java:544)
        at org.apache.fop.render.AbstractRenderer.renderBlock(AbstractRenderer.java:581)
        at org.apache.fop.render.intermediate.IFRenderer.renderBlock(IFRenderer.java:976)
        at org.apache.fop.render.AbstractRenderer.renderBlocks(AbstractRenderer.java:534)
        at org.apache.fop.render.AbstractRenderer.renderBlock(AbstractRenderer.java:581)
        at org.apache.fop.render.intermediate.IFRenderer.renderBlock(IFRenderer.java:976)
        at org.apache.fop.render.AbstractRenderer.renderBlocks(AbstractRenderer.java:534)
        at org.apache.fop.render.AbstractRenderer.renderBlock(AbstractRenderer.java:581)
        at org.apache.fop.render.intermediate.IFRenderer.renderBlock(IFRenderer.java:976)
        at org.apache.fop.render.AbstractRenderer.renderBlocks(AbstractRenderer.java:534)
        at org.apache.fop.render.AbstractRenderer.renderBlock(AbstractRenderer.java:581)
        at org.apache.fop.render.intermediate.IFRenderer.renderBlock(IFRenderer.java:976)
        at org.apache.fop.render.AbstractRenderer.renderBlocks(AbstractRenderer.java:534)
        at org.apache.fop.render.AbstractRenderer.renderBlock(AbstractRenderer.java:581)
        at org.apache.fop.render.intermediate.IFRenderer.renderBlock(IFRenderer.java:976)
        at org.apache.fop.render.AbstractRenderer.renderBlocks(AbstractRenderer.java:534)
        at org.apache.fop.render.AbstractRenderer.renderBlock(AbstractRenderer.java:581)
        at org.apache.fop.render.intermediate.IFRenderer.renderBlock(IFRenderer.java:976)
        at org.apache.fop.render.AbstractRenderer.renderBlocks(AbstractRenderer.java:534)
        at org.apache.fop.render.AbstractRenderer.renderFlow(AbstractRenderer.java:432)
        at org.apache.fop.render.AbstractPathOrientedRenderer.renderFlow(AbstractPathOrientedRenderer.java:665)
        at org.apache.fop.render.AbstractRenderer.renderMainReference(AbstractRenderer.java:411)
        at org.apache.fop.render.AbstractRenderer.renderBodyRegion(AbstractRenderer.java:345)
        at org.apache.fop.render.AbstractRenderer.renderRegionViewport(AbstractRenderer.java:292)
        at org.apache.fop.render.intermediate.IFRenderer.renderRegionViewport(IFRenderer.java:731)
        at org.apache.fop.render.AbstractRenderer.renderPageAreas(AbstractRenderer.java:265)
        at org.apache.fop.render.AbstractRenderer.renderPage(AbstractRenderer.java:230)
        at org.apache.fop.render.intermediate.IFRenderer.renderPage(IFRenderer.java:580)
        at org.apache.fop.area.RenderPagesModel.addPage(RenderPagesModel.java:114)
        at org.apache.fop.layoutmgr.AbstractPageSequenceLayoutManager.finishPage(AbstractPageSequenceLayoutManager.java:312)
        at org.apache.fop.layoutmgr.PageSequenceLayoutManager.finishPage(PageSequenceLayoutManager.java:167)
        at org.apache.fop.layoutmgr.AbstractPageSequenceLayoutManager.makeNewPage(AbstractPageSequenceLayoutManager.java:284)
        at org.apache.fop.layoutmgr.PageBreaker.handleBreakTrait(PageBreaker.java:526)
        at org.apache.fop.layoutmgr.PageBreaker.startPart(PageBreaker.java:429)
        at org.apache.fop.layoutmgr.AbstractBreaker.addAreas(AbstractBreaker.java:547)
        at org.apache.fop.layoutmgr.AbstractBreaker.addAreas(AbstractBreaker.java:497)
        at org.apache.fop.layoutmgr.PageBreaker.doPhase3(PageBreaker.java:308)
        at org.apache.fop.layoutmgr.AbstractBreaker.doLayout(AbstractBreaker.java:450)
        at org.apache.fop.layoutmgr.PageBreaker.doLayout(PageBreaker.java:85)
        at org.apache.fop.layoutmgr.PageSequenceLayoutManager.activateLayout(PageSequenceLayoutManager.java:107)
        at org.apache.fop.area.AreaTreeHandler.endPageSequence(AreaTreeHandler.java:238)
        at org.apache.fop.fo.pagination.PageSequence.endOfNode(PageSequence.java:120)
        at org.apache.fop.fo.FOTreeBuilder$MainFOHandler.endElement(FOTreeBuilder.java:349)
        at org.apache.fop.fo.FOTreeBuilder.endElement(FOTreeBuilder.java:177)
        at org.apache.xalan.transformer.TransformerIdentityImpl.endElement(TransformerIdentityImpl.java:1101)
        at org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown Source)
        at org.apache.xerces.xinclude.XIncludeHandler.endElement(Unknown Source)
        at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanEndElement(Unknown Source)
        at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
        at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
        at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
        at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
        at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
        at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
        at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source)
        at org.apache.xalan.transformer.TransformerIdentityImpl.transform(TransformerIdentityImpl.java:484)
        at org.apache.fop.cli.InputHandler.transformTo(InputHandler.java:299)
        at org.apache.fop.cli.InputHandler.renderTo(InputHandler.java:130)
        at org.apache.fop.cli.Main.startFOP(Main.java:174)
        at org.apache.fop.cli.Main.main(Main.java:205)
Caused by: java.lang.reflect.InvocationTargetException
        at sun.reflect.GeneratedMethodAccessor10.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:606)
        at org.apache.xmlgraphics.image.loader.impl.AbstractImageSessionContext$ObservingImageInputStreamInvocationHandler.invoke(AbstractImageSessionContext.java:219)
        ... 79 more
Caused by: java.net.SocketException: Connection reset
        at java.net.SocketInputStream.read(SocketInputStream.java:189)
        at java.net.SocketInputStream.read(SocketInputStream.java:121)
        at java.io.BufferedInputStream.fill(BufferedInputStream.java:235)
        at java.io.BufferedInputStream.read1(BufferedInputStream.java:275)
        at java.io.BufferedInputStream.read(BufferedInputStream.java:334)
        at sun.net.www.MeteredStream.read(MeteredStream.java:134)
        at java.io.FilterInputStream.read(FilterInputStream.java:133)
        at sun.net.www.protocol.http.HttpURLConnection$HttpInputStream.read(HttpURLConnection.java:3052)
        at java.io.BufferedInputStream.fill(BufferedInputStream.java:235)
        at java.io.BufferedInputStream.read1(BufferedInputStream.java:275)
        at java.io.BufferedInputStream.read(BufferedInputStream.java:334)
        at javax.imageio.stream.FileCacheImageInputStream.readUntil(FileCacheImageInputStream.java:141)
        at javax.imageio.stream.FileCacheImageInputStream.read(FileCacheImageInputStream.java:187)
        at javax.imageio.stream.ImageInputStreamImpl.read(ImageInputStreamImpl.java:155)
        ... 83 more

../../../config/docbook.mk:561: recipe for target `../output/pdf/soft_dev_basic.pdf' failed
make[1]: *** [../output/pdf/soft_dev_basic.pdf] Error 1
make[1]: 离开目录“/cygdrive/e/Dev_Root/docbook/dev/books/soft_dev_basic/src”
/cygdrive/e/Dev_Root/docbook/dev/books/symbology_code128/src
make[1]: 进入目录“/cygdrive/e/Dev_Root/docbook/dev/books/symbology_code128/src”

但是很明显,仍旧没有停止编译。

导致:

以后,万一其他某个book出错,也还是无法发现问题所在

所以:

此处的:

E:\Dev_Root\docbook\dev\books\Makefile

目前至少有两个问题:

(1)make clean

为何没有删除掉:

E:\Dev_Root\docbook\dev\books\soft_dev_basic\output\fo\soft_dev_basic.fo

(2)make xxx

包括

make release

make html/pdf/…

make release_copy

如果任意一个子的book出错,都应该停止

当然,如果对于其他比如chm内部调用hhc时出错,那要想办法避免掉

比如调用hhc时,用短横线-前缀,表示此行如果出错则忽略

总之要:

发现子的book的错误才行。

【解决过程】

1.先再去确认一下,make clean,是否可以正常删除。

貌似make clean是正常的。

2.再去确认,sub level的makefile出错,如何确保一定传递给顶层的makefile。

去故意制造了一个子book的错误,目前编译html出错后,仍旧继续编译:

Administrator@PC-20130611GART /cygdrive/e/Dev_Root/docbook/dev/books
$ make all
Current path=/cygdrive/e/Dev_Root/docbook/dev/books
LS_OUTPUT=arm_vs_mips binutils_intro build_website buy_house char_encoding compute_basic crifan_rec_soft crifanlib_csharp crifanlib_python cross_compile crosstool_ng csharp_summary cygwin_intro dma_pl08x_analysis docbook_dev_note english_learn entity_common_multi_format.xml entity_common_multi_format_en.xml entity_common_publish_info.xml entity_common_publish_info_en.xml fieldbus_intro firmware_download hardware_basic interrupt_related json_tutorial language_dev_basic language_summary linux_nand_driver linux_wireless Makefile Makefile.bak mpeg_vbr nand_get_type programming_language_basic python_beginner_tutorial python_intermediate_tutorial python_summary python_topic_beautifulsoup python_topic_re python_topic_str_encoding python_topic_web_scrape rec_soft_npp regular_expression remove_bak.sh runtime_upgrade_linux soft_dev_basic symbology_code128 symbology_gs1128 symbology_plessey symbology_upc tutorial_regex uboot_starts_analysis usb_basic usb_disk_driver usb_hid virtualbox_tutorial virutal_machine_tutorial vmware_tutorial web_scrape_emulate_login website_transfer
for each_item in arm_vs_mips binutils_intro build_website buy_house char_encoding compute_basic crifan_rec_soft crifanlib_csharp crifanlib_python cross_compile crosstool_ng csharp_summary cygwin_intro dma_pl08x_analysis docbook_dev_note english_learn entity_common_multi_format.xml entity_common_multi_format_en.xml entity_common_publish_info.xml entity_common_publish_info_en.xml fieldbus_intro firmware_download hardware_basic interrupt_related json_tutorial language_dev_basic language_summary linux_nand_driver linux_wireless Makefile Makefile.bak mpeg_vbr nand_get_type programming_language_basic python_beginner_tutorial python_intermediate_tutorial python_summary python_topic_beautifulsoup python_topic_re python_topic_str_encoding python_topic_web_scrape rec_soft_npp regular_expression remove_bak.sh runtime_upgrade_linux soft_dev_basic symbology_code128 symbology_gs1128 symbology_plessey symbology_upc tutorial_regex uboot_starts_analysis usb_basic usb_disk_driver usb_hid virtualbox_tutorial virutal_machine_tutorial vmware_tutorial web_scrape_emulate_login website_transfer; \
do {\
    if [ -d $each_item/src ]; then \
            cd  $each_item/src && \
            echo `pwd` && \
            if [ -f Makefile ]; then \
                make all; \
            fi; \
            cd ../..; \
    fi; \
    } || exit "$?";\
done;
/cygdrive/e/Dev_Root/docbook/dev/books/arm_vs_mips/src
make[1]: 进入目录“/cygdrive/e/Dev_Root/docbook/dev/books/arm_vs_mips/src”
=============================== generating arm_vs_mips fo ==============================
export XML_CATALOG_FILES="/home/develop/docbook/config_root/catalog/catalog.xml" && \
export XML_DEBUG_CATALOG=1 && \
xsltproc --xinclude  --stringparam callout.graphics 1  --stringparam admon.graphics 1 --stringparam callout.graphics.number.limit 30 --stringparam callout.graphics.extension .svg --stringparam callout.graphics.path E:/Dev_Root/docbook/dev/config/images/system/callouts/ --stringparam admon.graphics.extension .svg --stringparam admon.graphics.path E:/Dev_Root/docbook/dev/config/images/system/colorsvg/ -o ../output/fo/arm_vs_mips.fo docbook_fo_crl.xsl arm_vs_mips.xml
Resolve: sysID docbook_fo_crl.xsl
-2147483592 Parsing catalog /home/develop/docbook/config_root/catalog/catalog.xml
/home/develop/docbook/config_root/catalog/catalog.xml added to file hash
Resolve URI docbook_fo_crl.xsl
Found URI match docbook_fo_crl.xsl
Resolve: pubID crl.ent sysID http://www.crifan.com/files/res/docbook/entity/crl.ent
Found public match crl.ent
ch01_reduced_instruction_set.xml:20: parser error : Specification mandate value for attribute xml
<sect1 xml id="arm_thumb_mode"><title>ARM涓殑Thumb妯″紡</title>
           ^
ch01_reduced_instruction_set.xml:20: parser error : attributes construct error
<sect1 xml id="arm_thumb_mode"><title>ARM涓殑Thumb妯″紡</title>
           ^
ch01_reduced_instruction_set.xml:20: parser error : Couldn't find end of Start Tag sect1 line 20
<sect1 xml id="arm_thumb_mode"><title>ARM涓殑Thumb妯″紡</title>
           ^
ch01_reduced_instruction_set.xml:29: parser error : Opening and ending tag mismatch: chapter line 11 and sect1
</sect1>
        ^
ch01_reduced_instruction_set.xml:31: parser error : Extra content at the end of the document
<sect1 xml:id="mips_mips16e_ase"><title>MIPS涓殑MIPS16e ASE</title>
^
arm_vs_mips.xml:62: element include: XInclude error : could not load ch01_reduced_instruction_set.xml, and no fallback was found
Catalogs cleanup
Free catalog entry crl.ent
Free catalog entry /home/develop/docbook/tools_root/docbook-xsl-ns-1.78.1/
Free catalog entry docbook_html.xsl
Free catalog entry docbook_fo.xsl
Free catalog entry /home/develop/docbook/config_root/docbook-xsl-ns-1.78.1/
Free catalog entry docbook_html_crl.xsl
Free catalog entry chunk_html_crl.xsl
Free catalog entry docbook_htmlhelp_crl.xsl
Free catalog entry docbook_fo_crl.xsl
Free catalog entry docbook_webhelp_crl.xsl
Free catalog entry /home/develop/docbook/config_root/catalog/catalog.xml
Free catalog entry
../../../config/docbook.mk:552: recipe for target `../output/fo/arm_vs_mips.fo' failed
make[1]: *** [../output/fo/arm_vs_mips.fo] Error 6
make[1]: 离开目录“/cygdrive/e/Dev_Root/docbook/dev/books/arm_vs_mips/src”
/cygdrive/e/Dev_Root/docbook/dev/books/binutils_intro/src
make[1]: 进入目录“/cygdrive/e/Dev_Root/docbook/dev/books/binutils_intro/src”
=============================== generating binutils_intro fo ==============================
export XML_CATALOG_FILES="/home/develop/docbook/config_root/catalog/catalog.xml" && \

所以,去想办法,当make xxx出错后,就停止。

3.结果是去参考自己的帖子:

【已解决】makefile出现错误却不停止,却继续运行

然后从:

# [Filename]
# books\Makefile
#
# [Function]
# docbook top level makefile
# to batch compile/clean sub docbook books
# such as: clean/clean_all/clean_release/all/release
#
# [Version]
# 2013-10-04
#
# [Author]
# Crifan Li
# 
# [Note]
# 1. this makefile should be located in the parent dir of src Makefile

LS_OUTPUT=$(shell ls)
#SUB_BOOKS=LS_OUTPUT
#SUB_BOOKS=$(shell for each_ls in $(LS_OUTPUT);do if [ -d $each_ls ]; then $(SUB_BOOKS)+=$each_ls; fi; done) 
#SUB_BOOKS := $(foreach each_ls, $(LS_OUTPUT), $(if test -d $(each_ls), $(each_ls)))

# all:      make_all
# release:  make_release
# clean:            make_clean
# clean_all:        make_clean_all
# clean_release:    make_clean_release

#goto every sub foler(single book)'s src dir to do 'make xxx' action
clean clean_all clean_release all release release_copy pdf_copy:
	@echo "Current path="`pwd`;
	@echo "LS_OUTPUT="$(LS_OUTPUT);
	for each_item in $(LS_OUTPUT); \
	do {\
	    if [ -d $$each_item/src ]; then \
	            cd  $$each_item/src && \
	            echo `pwd` && \
	            if [ -f Makefile ]; then \
	                make $@; \
	            fi; \
	            cd ../..; \
	    fi; \
	    } || exit "$$?";\
	done;

改为:

# [Filename]
# books\Makefile
#
# [Function]
# docbook top level makefile
# to batch compile/clean sub docbook books
# such as: clean/clean_all/clean_release/all/release
#
# [Version]
# 2013-10-04
#
# [Author]
# Crifan Li
# 
# [Note]
# 1. this makefile should be located in the parent dir of src Makefile

LS_OUTPUT=$(shell ls)
#SUB_BOOKS=LS_OUTPUT
#SUB_BOOKS=$(shell for each_ls in $(LS_OUTPUT);do if [ -d $each_ls ]; then $(SUB_BOOKS)+=$each_ls; fi; done) 
#SUB_BOOKS := $(foreach each_ls, $(LS_OUTPUT), $(if test -d $(each_ls), $(each_ls)))

# all:      make_all
# release:  make_release
# clean:            make_clean
# clean_all:        make_clean_all
# clean_release:    make_clean_release

#goto every sub foler(single book)'s src dir to do 'make xxx' action
clean clean_all clean_release all release release_copy pdf_copy:
	@echo "Current path="`pwd`;
	@echo "LS_OUTPUT="$(LS_OUTPUT);
	for each_item in $(LS_OUTPUT); \
	do \
	    if [ -d $$each_item/src ]; then \
	            cd  $$each_item/src && \
	            echo `pwd` && \
	            if [ -f Makefile ]; then \
	                make $@ || exit "$$?"; \
	            fi; \
	            cd ../..; \
	    fi; \
	done;

就可以实现要的效果了:

当某个子的book编译出错,则停止:

Administrator@PC-20130611GART /cygdrive/e/Dev_Root/docbook/dev/books
$ make all
Current path=/cygdrive/e/Dev_Root/docbook/dev/books
LS_OUTPUT=arm_vs_mips binutils_intro build_website buy_house char_encoding compute_basic crifan_rec_soft crifanlib_csharp crifanlib_python cross_compile crosstool_ng csharp_summary cygwin_intro dma_pl08x_analysis docbook_dev_note english_learn entity_common_multi_format.xml entity_common_multi_format_en.xml entity_common_publish_info.xml entity_common_publish_info_en.xml fieldbus_intro firmware_download hardware_basic interrupt_related json_tutorial language_dev_basic language_summary linux_nand_driver linux_wireless Makefile Makefile.bak mpeg_vbr nand_get_type programming_language_basic python_beginner_tutorial python_intermediate_tutorial python_summary python_topic_beautifulsoup python_topic_re python_topic_str_encoding python_topic_web_scrape rec_soft_npp regular_expression remove_bak.sh runtime_upgrade_linux soft_dev_basic symbology_code128 symbology_gs1128 symbology_plessey symbology_upc tutorial_regex uboot_starts_analysis usb_basic usb_disk_driver usb_hid virtualbox_tutorial virutal_machine_tutorial vmware_tutorial web_scrape_emulate_login website_transfer
for each_item in arm_vs_mips binutils_intro build_website buy_house char_encoding compute_basic crifan_rec_soft crifanlib_csharp crifanlib_python cross_compile crosstool_ng csharp_summary cygwin_intro dma_pl08x_analysis docbook_dev_note english_learn entity_common_multi_format.xml entity_common_multi_format_en.xml entity_common_publish_info.xml entity_common_publish_info_en.xml fieldbus_intro firmware_download hardware_basic interrupt_related json_tutorial language_dev_basic language_summary linux_nand_driver linux_wireless Makefile Makefile.bak mpeg_vbr nand_get_type programming_language_basic python_beginner_tutorial python_intermediate_tutorial python_summary python_topic_beautifulsoup python_topic_re python_topic_str_encoding python_topic_web_scrape rec_soft_npp regular_expression remove_bak.sh runtime_upgrade_linux soft_dev_basic symbology_code128 symbology_gs1128 symbology_plessey symbology_upc tutorial_regex uboot_starts_analysis usb_basic usb_disk_driver usb_hid virtualbox_tutorial virutal_machine_tutorial vmware_tutorial web_scrape_emulate_login website_transfer; \
do \
    if [ -d $each_item/src ]; then \
            cd  $each_item/src && \
            echo `pwd` && \
            if [ -f Makefile ]; then \
                make all || exit "$?"; \
            fi; \
            cd ../..; \
    fi; \
done;
/cygdrive/e/Dev_Root/docbook/dev/books/arm_vs_mips/src
make[1]: 进入目录“/cygdrive/e/Dev_Root/docbook/dev/books/arm_vs_mips/src”
=============================== generating arm_vs_mips fo ==============================
export XML_CATALOG_FILES="/home/develop/docbook/config_root/catalog/catalog.xml" && \
export XML_DEBUG_CATALOG=1 && \
xsltproc --xinclude  --stringparam callout.graphics 1  --stringparam admon.graphics 1 --stringparam callout.graphics.number.limit 30 --stringparam callout.graphics.extension .svg --stringparam callout.graphics.path E:/Dev_Root/docbook/dev/config/images/system/callouts/ --stringparam admon.graphics.extension .svg --stringparam admon.graphics.path E:/Dev_Root/docbook/dev/config/images/system/colorsvg/ -o ../output/fo/arm_vs_mips.fo docbook_fo_crl.xsl arm_vs_mips.xml
Resolve: sysID docbook_fo_crl.xsl
-2147483592 Parsing catalog /home/develop/docbook/config_root/catalog/catalog.xml
/home/develop/docbook/config_root/catalog/catalog.xml added to file hash
Resolve URI docbook_fo_crl.xsl
Found URI match docbook_fo_crl.xsl
Resolve: pubID crl.ent sysID http://www.crifan.com/files/res/docbook/entity/crl.ent
Found public match crl.ent
ch01_reduced_instruction_set.xml:20: parser error : Specification mandate value for attribute xml
<sect1 xml id="arm_thumb_mode"><title>ARM涓殑Thumb妯″紡</title>
           ^
ch01_reduced_instruction_set.xml:20: parser error : attributes construct error
<sect1 xml id="arm_thumb_mode"><title>ARM涓殑Thumb妯″紡</title>
           ^
ch01_reduced_instruction_set.xml:20: parser error : Couldn't find end of Start Tag sect1 line 20
<sect1 xml id="arm_thumb_mode"><title>ARM涓殑Thumb妯″紡</title>
           ^
ch01_reduced_instruction_set.xml:29: parser error : Opening and ending tag mismatch: chapter line 11 and sect1
</sect1>
        ^
ch01_reduced_instruction_set.xml:31: parser error : Extra content at the end of the document
<sect1 xml:id="mips_mips16e_ase"><title>MIPS涓殑MIPS16e ASE</title>
^
arm_vs_mips.xml:62: element include: XInclude error : could not load ch01_reduced_instruction_set.xml, and no fallback was found
Catalogs cleanup
Free catalog entry crl.ent
Free catalog entry /home/develop/docbook/tools_root/docbook-xsl-ns-1.78.1/
Free catalog entry docbook_html.xsl
Free catalog entry docbook_fo.xsl
Free catalog entry /home/develop/docbook/config_root/docbook-xsl-ns-1.78.1/
Free catalog entry docbook_html_crl.xsl
Free catalog entry chunk_html_crl.xsl
Free catalog entry docbook_htmlhelp_crl.xsl
Free catalog entry docbook_fo_crl.xsl
Free catalog entry docbook_webhelp_crl.xsl
Free catalog entry /home/develop/docbook/config_root/catalog/catalog.xml
Free catalog entry
../../../config/docbook.mk:552: recipe for target `../output/fo/arm_vs_mips.fo' failed
make[1]: *** [../output/fo/arm_vs_mips.fo] Error 6
make[1]: 离开目录“/cygdrive/e/Dev_Root/docbook/dev/books/arm_vs_mips/src”
Makefile:31: recipe for target `all' failed
make: *** [all] Error 2

Administrator@PC-20130611GART /cygdrive/e/Dev_Root/docbook/dev/books
$

4.再把echo信息去掉:

# [Filename]
# books\Makefile
#
# [Function]
# docbook top level makefile
# to batch compile/clean sub docbook books
# such as: clean/clean_all/clean_release/all/release
#
# [Version]
# 2013-10-04
#
# [Author]
# Crifan Li
# 
# [Note]
# 1. this makefile should be located in the parent dir of src Makefile

#LS_OUTPUT=$(shell ls)
SUB_BOOKS=$(shell ls)
#SUB_BOOKS=LS_OUTPUT
#SUB_BOOKS=$(shell for each_ls in $(LS_OUTPUT);do if [ -d $each_ls ]; then $(SUB_BOOKS)+=$each_ls; fi; done) 
#SUB_BOOKS := $(foreach each_ls, $(LS_OUTPUT), $(if test -d $(each_ls), $(each_ls)))

# all:      make_all
# release:  make_release
# clean:            make_clean
# clean_all:        make_clean_all
# clean_release:    make_clean_release

#goto every sub foler(single book)'s src dir to do 'make xxx' action
clean clean_all clean_release all release release_copy pdf_copy:
	@echo "Current path="`pwd`;
	@echo "LS_OUTPUT="$(SUB_BOOKS);
	@for each_item in $(SUB_BOOKS); \
	do \
	    if [ -d $$each_item/src ]; then \
	            cd  $$each_item/src && \
	            echo `pwd` && \
	            if [ -f Makefile ]; then \
	                make $@ || exit "$$?"; \
	            fi; \
	            cd ../..; \
	    fi; \
	done;

效果是:

Administrator@PC-20130611GART /cygdrive/e/Dev_Root/docbook/dev/books
$ make all
Current path=/cygdrive/e/Dev_Root/docbook/dev/books
LS_OUTPUT=arm_vs_mips binutils_intro build_website buy_house char_encoding compute_basic crifan_rec_soft crifanlib_csharp crifanlib_python cross_compile crosstool_ng csharp_summary cygwin_intro dma_pl08x_analysis docbook_dev_note english_learn entity_common_multi_format.xml entity_common_multi_format_en.xml entity_common_publish_info.xml entity_common_publish_info_en.xml fieldbus_intro firmware_download hardware_basic interrupt_related json_tutorial language_dev_basic language_summary linux_nand_driver linux_wireless Makefile Makefile.bak mpeg_vbr nand_get_type programming_language_basic python_beginner_tutorial python_intermediate_tutorial python_summary python_topic_beautifulsoup python_topic_re python_topic_str_encoding python_topic_web_scrape rec_soft_npp regular_expression remove_bak.sh runtime_upgrade_linux soft_dev_basic symbology_code128 symbology_gs1128 symbology_plessey symbology_upc tutorial_regex uboot_starts_analysis usb_basic usb_disk_driver usb_hid virtualbox_tutorial virutal_machine_tutorial vmware_tutorial web_scrape_emulate_login website_transfer
/cygdrive/e/Dev_Root/docbook/dev/books/arm_vs_mips/src
make[1]: 进入目录“/cygdrive/e/Dev_Root/docbook/dev/books/arm_vs_mips/src”
=============================== generating arm_vs_mips fo ==============================
export XML_CATALOG_FILES="/home/develop/docbook/config_root/catalog/catalog.xml" && \
export XML_DEBUG_CATALOG=1 && \
xsltproc --xinclude  --stringparam callout.graphics 1  --stringparam admon.graphics 1 --stringparam callout.graphics.number.limit 30 --stringparam callout.graphics.extension .svg --stringparam callout.graphics.path E:/Dev_Root/docbook/dev/config/images/system/callouts/ --stringparam admon.graphics.extension .svg --stringparam admon.graphics.path E:/Dev_Root/docbook/dev/config/images/system/colorsvg/ -o ../output/fo/arm_vs_mips.fo docbook_fo_crl.xsl arm_vs_mips.xml
Resolve: sysID docbook_fo_crl.xsl
-2147483592 Parsing catalog /home/develop/docbook/config_root/catalog/catalog.xml
/home/develop/docbook/config_root/catalog/catalog.xml added to file hash
Resolve URI docbook_fo_crl.xsl
Found URI match docbook_fo_crl.xsl
Resolve: pubID crl.ent sysID http://www.crifan.com/files/res/docbook/entity/crl.ent
Found public match crl.ent
ch01_reduced_instruction_set.xml:20: parser error : Specification mandate value for attribute xml
<sect1 xml id="arm_thumb_mode"><title>ARM涓殑Thumb妯″紡</title>
           ^
ch01_reduced_instruction_set.xml:20: parser error : attributes construct error
<sect1 xml id="arm_thumb_mode"><title>ARM涓殑Thumb妯″紡</title>
           ^
ch01_reduced_instruction_set.xml:20: parser error : Couldn't find end of Start Tag sect1 line 20
<sect1 xml id="arm_thumb_mode"><title>ARM涓殑Thumb妯″紡</title>
           ^
ch01_reduced_instruction_set.xml:29: parser error : Opening and ending tag mismatch: chapter line 11 and sect1
</sect1>
        ^
ch01_reduced_instruction_set.xml:31: parser error : Extra content at the end of the document
<sect1 xml:id="mips_mips16e_ase"><title>MIPS涓殑MIPS16e ASE</title>
^
arm_vs_mips.xml:62: element include: XInclude error : could not load ch01_reduced_instruction_set.xml, and no fallback was found
Catalogs cleanup
Free catalog entry crl.ent
Free catalog entry /home/develop/docbook/tools_root/docbook-xsl-ns-1.78.1/
Free catalog entry docbook_html.xsl
Free catalog entry docbook_fo.xsl
Free catalog entry /home/develop/docbook/config_root/docbook-xsl-ns-1.78.1/
Free catalog entry docbook_html_crl.xsl
Free catalog entry chunk_html_crl.xsl
Free catalog entry docbook_htmlhelp_crl.xsl
Free catalog entry docbook_fo_crl.xsl
Free catalog entry docbook_webhelp_crl.xsl
Free catalog entry /home/develop/docbook/config_root/catalog/catalog.xml
Free catalog entry
../../../config/docbook.mk:552: recipe for target `../output/fo/arm_vs_mips.fo' failed
make[1]: *** [../output/fo/arm_vs_mips.fo] Error 6
make[1]: 离开目录“/cygdrive/e/Dev_Root/docbook/dev/books/arm_vs_mips/src”
Makefile:32: recipe for target `all' failed
make: *** [all] Error 2

Administrator@PC-20130611GART /cygdrive/e/Dev_Root/docbook/dev/books
$

 

【总结】

这个问题,之前自己解决了,但是此处忘了同步更新过来了。

搞得还是参考自己的帖子,改为修正后的内容。

完整内容如下:

# [Filename]
# books\Makefile
#
# [Function]
# docbook top level makefile
# to batch compile/clean sub docbook books
# such as: clean/clean_all/clean_release/all/release
#
# [Version]
# 2013-10-04
#
# [Author]
# Crifan Li
# 
# [Note]
# 1. this makefile should be located in the parent dir of src Makefile

#LS_OUTPUT=$(shell ls)
SUB_BOOKS=$(shell ls)
#SUB_BOOKS=LS_OUTPUT
#SUB_BOOKS=$(shell for each_ls in $(LS_OUTPUT);do if [ -d $each_ls ]; then $(SUB_BOOKS)+=$each_ls; fi; done) 
#SUB_BOOKS := $(foreach each_ls, $(LS_OUTPUT), $(if test -d $(each_ls), $(each_ls)))

# all:      make_all
# release:  make_release
# clean:            make_clean
# clean_all:        make_clean_all
# clean_release:    make_clean_release

#goto every sub foler(single book)'s src dir to do 'make xxx' action
clean clean_all clean_release all release release_copy pdf_copy:
	@echo "Current path="`pwd`;
	@echo "LS_OUTPUT="$(SUB_BOOKS);
	@for each_item in $(SUB_BOOKS); \
	do \
	    if [ -d $$each_item/src ]; then \
	            cd  $$each_item/src && \
	            echo `pwd` && \
	            if [ -f Makefile ]; then \
	                make $@ || exit "$$?"; \
	            fi; \
	            cd ../..; \
	    fi; \
	done;



发表评论

电子邮件地址不会被公开。 必填项已用*标注

无觅相关文章插件,快速提升流量