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_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) -rRs 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 $(API_EXAMPLES)
89 $(Q)rm -f $(RTE_OUTPUT)/doc/html/api/*
90 $(Q)rmdir -p --ignore-fail-on-non-empty $(RTE_OUTPUT)/doc/html/api 2>&- || true
92 $(API_EXAMPLES): api-html-clean
94 @printf '/**\n' > $(API_EXAMPLES)
95 @printf '@page examples DPDK Example Programs\n\n' >> $(API_EXAMPLES)
96 @find examples -type f -name '*.c' -printf '@example %p\n' | LC_ALL=C sort >> $(API_EXAMPLES)
97 @printf '*/\n' >> $(API_EXAMPLES)
99 guides-pdf-clean: guides-pdf-img-clean
100 guides-pdf-img-clean:
101 $(Q)rm -f $(RTE_SDK)/doc/guides/*/img/*.pdf
104 $(Q)rm -rf $(RTE_OUTPUT)/doc/$*/guides
105 $(Q)rmdir -p --ignore-fail-on-non-empty $(RTE_OUTPUT)/doc/$* 2>&- || true
107 guides-pdf: $(addprefix guides-pdf-, $(notdir $(RTE_GUIDES:/=))) ;
109 @echo 'sphinx processing $@...'
110 $(Q)$(RTE_SPHINX_BUILD) -b latex $(RTE_SPHINX_VERBOSE) \
111 -c $(RTE_SDK)/doc/guides $(RTE_SDK)/doc/guides/$* \
112 $(RTE_OUTPUT)/doc/pdf/guides/$*
113 $(if $^,$(Q)rm -f $^)
114 @echo 'pdflatex processing $@...'
115 $(Q)$(MAKE) all-pdf -sC $(RTE_OUTPUT)/doc/pdf/guides/$* \
116 LATEXOPTS=$(RTE_PDFLATEX_VERBOSE)
117 $(Q)mv $(RTE_OUTPUT)/doc/pdf/guides/$*/doc.pdf \
118 $(RTE_OUTPUT)/doc/pdf/guides/$*.pdf
121 $(Q)install -D -m0644 $(RTE_SDK)/doc/guides/custom.css \
122 $(RTE_OUTPUT)/doc/html/guides/_static/css/custom.css
126 guides-%: guides-%-prepare
127 @echo 'sphinx processing $@...'
128 $(Q)$(RTE_SPHINX_BUILD) -b $* $(RTE_SPHINX_VERBOSE) \
129 -c $(RTE_SDK)/doc/guides $(RTE_SDK)/doc/guides \
130 $(RTE_OUTPUT)/doc/$*/guides
132 # Each PDF depends on generated images *.pdf from *.svg
133 $(foreach guide, $(RTE_GUIDES), $(foreach img, $(wildcard $(guide)img/*.svg), \
134 $(eval guides-pdf-$(notdir $(guide:/=)): $(img:svg=pdf))))
136 $(Q)inkscape -d $(RTE_PDF_DPI) -D -f $< -A $@ $(RTE_INKSCAPE_VERBOSE)