3 # Copyright(c) 2010-2015 Intel Corporation. All rights reserved.
4 # Copyright(c) 2013-2015 6WIND S.A.
7 # Redistribution and use in source and binary forms, with or without
8 # modification, are permitted provided that the following conditions
11 # * Redistributions of source code must retain the above copyright
12 # notice, this list of conditions and the following disclaimer.
13 # * Redistributions in binary form must reproduce the above copyright
14 # notice, this list of conditions and the following disclaimer in
15 # the documentation and/or other materials provided with the
17 # * Neither the name of Intel Corporation nor the names of its
18 # contributors may be used to endorse or promote products derived
19 # from this software without specific prior written permission.
21 # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
22 # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
23 # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
24 # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
25 # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
26 # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
27 # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
28 # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
29 # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
30 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
31 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
34 ifeq ("$(origin T)", "command line")
35 $(error "Cannot use T= with doc target")
39 RTE_SPHINX_BUILD = sphinx-build
40 RTE_PDFLATEX_VERBOSE := --interaction=nonstopmode
43 RTE_SPHINX_VERBOSE := -q
44 RTE_PDFLATEX_VERBOSE := --interaction=batchmode
45 RTE_INKSCAPE_VERBOSE := >/dev/null 2>&1
48 RTE_SPHINX_VERBOSE := -q
49 RTE_PDFLATEX_VERBOSE := --interaction=batchmode
50 RTE_INKSCAPE_VERBOSE := >/dev/null 2>&1
55 RTE_GUIDES := $(filter %/, $(wildcard $(RTE_SDK)/doc/guides/*/))
57 API_EXAMPLES := $(RTE_OUTPUT)/doc/html/examples.dox
61 @cat $(RTE_SDK)/doc/build-sdk-quick.txt
62 @$(MAKE) -rR showconfigs | sed 's,^,\t\t\t\t,'
65 all: api-html guides-html guides-pdf
68 clean: api-html-clean guides-html-clean guides-pdf-clean guides-man-clean
71 api-html: api-html-clean $(API_EXAMPLES)
72 @echo 'doxygen for API...'
73 $(Q)mkdir -p $(RTE_OUTPUT)/doc/html
74 $(Q)(cat $(RTE_SDK)/doc/api/doxy-api.conf && \
75 printf 'PROJECT_NUMBER = ' && \
76 $(MAKE) -rR showversion && \
77 echo INPUT += $(API_EXAMPLES) && \
78 echo OUTPUT_DIRECTORY = $(RTE_OUTPUT)/doc && \
79 echo HTML_OUTPUT = html/api && \
80 echo GENERATE_HTML = YES && \
81 echo GENERATE_LATEX = NO && \
82 echo GENERATE_MAN = NO )| \
84 $(Q)$(RTE_SDK)/doc/api/doxy-html-custom.sh $(RTE_OUTPUT)/doc/html/api/doxygen.css
86 .PHONY: api-html-clean
88 $(Q)rm -f $(RTE_OUTPUT)/doc/html/api/*
89 $(Q)rmdir -p --ignore-fail-on-non-empty $(RTE_OUTPUT)/doc/html/api 2>&- || true
92 $(Q)mkdir -p $(RTE_OUTPUT)/doc/html
93 @printf '/**\n' > $(API_EXAMPLES)
94 @printf '@page examples DPDK Example Programs\n\n' >> $(API_EXAMPLES)
95 @find examples -type f -name '*.c' -printf '@example %p\n' >> $(API_EXAMPLES)
96 @printf '*/\n' >> $(API_EXAMPLES)
98 guides-pdf-clean: guides-pdf-img-clean
100 $(Q)rm -f $(RTE_SDK)/doc/guides/*/img/*.pdf
103 $(Q)rm -rf $(RTE_OUTPUT)/doc/$*/guides
104 $(Q)rmdir -p --ignore-fail-on-non-empty $(RTE_OUTPUT)/doc/$* 2>&- || true
106 guides-pdf: $(addprefix guides-pdf-, $(notdir $(RTE_GUIDES:/=))) ;
108 @echo 'sphinx processing $@...'
109 $(Q)$(RTE_SPHINX_BUILD) -b latex $(RTE_SPHINX_VERBOSE) \
110 -c $(RTE_SDK)/doc/guides $(RTE_SDK)/doc/guides/$* \
111 $(RTE_OUTPUT)/doc/pdf/guides/$*
112 $(if $^,$(Q)rm -f $^)
113 @echo 'pdflatex processing $@...'
114 $(Q)$(MAKE) all-pdf -sC $(RTE_OUTPUT)/doc/pdf/guides/$* \
115 LATEXOPTS=$(RTE_PDFLATEX_VERBOSE)
116 $(Q)mv $(RTE_OUTPUT)/doc/pdf/guides/$*/doc.pdf \
117 $(RTE_OUTPUT)/doc/pdf/guides/$*.pdf
120 @echo 'sphinx processing $@...'
121 $(Q)$(RTE_SPHINX_BUILD) -b $* $(RTE_SPHINX_VERBOSE) \
122 -c $(RTE_SDK)/doc/guides $(RTE_SDK)/doc/guides \
123 $(RTE_OUTPUT)/doc/$*/guides
125 # Each PDF depends on generated images *.pdf from *.svg
126 $(foreach guide, $(RTE_GUIDES), $(foreach img, $(wildcard $(guide)img/*.svg), \
127 $(eval guides-pdf-$(notdir $(guide:/=)): $(img:svg=pdf))))
129 $(Q)inkscape -d $(RTE_PDF_DPI) -D -f $< -A $@ $(RTE_INKSCAPE_VERBOSE)