1 # SPDX-License-Identifier: BSD-3-Clause
2 # Copyright(c) 2010-2015 Intel Corporation.
3 # Copyright(c) 2013-2015 6WIND S.A.
6 ifeq ("$(origin T)", "command line")
7 $(error "Cannot use T= with doc target")
11 RTE_SPHINX_BUILD = sphinx-build
12 RTE_PDFLATEX_VERBOSE := --interaction=nonstopmode
15 RTE_SPHINX_VERBOSE := -q
16 RTE_PDFLATEX_VERBOSE := --interaction=batchmode
17 RTE_INKSCAPE_VERBOSE := >/dev/null 2>&1
20 RTE_SPHINX_VERBOSE := -q
21 RTE_PDFLATEX_VERBOSE := --interaction=batchmode
22 RTE_INKSCAPE_VERBOSE := >/dev/null 2>&1
27 RTE_GUIDES := $(filter %/, $(wildcard $(RTE_SDK)/doc/guides/*/))
29 API_EXAMPLES := $(RTE_OUTPUT)/doc/html/examples.dox
33 @cat $(RTE_SDK)/doc/build-sdk-quick.txt
34 @$(MAKE) -rR showconfigs | sed 's,^,\t\t\t\t,'
37 all: api-html guides-html guides-pdf
40 clean: api-html-clean guides-html-clean guides-pdf-clean guides-man-clean
43 api-html: $(API_EXAMPLES)
44 @echo 'doxygen for API...'
45 $(Q)mkdir -p $(RTE_OUTPUT)/doc/html
46 $(Q)(cat $(RTE_SDK)/doc/api/doxy-api.conf && \
47 printf 'PROJECT_NUMBER = ' && \
48 $(MAKE) -rRs showversion && \
49 echo INPUT += $(API_EXAMPLES) && \
50 echo OUTPUT_DIRECTORY = $(RTE_OUTPUT)/doc && \
51 echo HTML_OUTPUT = html/api && \
52 echo GENERATE_HTML = YES && \
53 echo GENERATE_LATEX = NO && \
54 echo GENERATE_MAN = NO )| \
56 $(Q)$(RTE_SDK)/doc/api/doxy-html-custom.sh $(RTE_OUTPUT)/doc/html/api/doxygen.css
58 .PHONY: api-html-clean
60 $(Q)rm -f $(API_EXAMPLES)
61 $(Q)rm -f $(RTE_OUTPUT)/doc/html/api/*
62 $(Q)rmdir -p --ignore-fail-on-non-empty $(RTE_OUTPUT)/doc/html/api 2>&- || true
64 $(API_EXAMPLES): api-html-clean
66 @printf '/**\n' > $(API_EXAMPLES)
67 @printf '@page examples DPDK Example Programs\n\n' >> $(API_EXAMPLES)
68 @find examples -type f -name '*.c' -printf '@example %p\n' | LC_ALL=C sort >> $(API_EXAMPLES)
69 @printf '*/\n' >> $(API_EXAMPLES)
71 guides-pdf-clean: guides-pdf-img-clean
73 $(Q)rm -f $(RTE_SDK)/doc/guides/*/img/*.pdf
76 $(Q)rm -rf $(RTE_OUTPUT)/doc/$*/guides
77 $(Q)rmdir -p --ignore-fail-on-non-empty $(RTE_OUTPUT)/doc/$* 2>&- || true
79 guides-pdf: $(addprefix guides-pdf-, $(notdir $(RTE_GUIDES:/=))) ;
81 @echo 'sphinx processing $@...'
82 $(Q)$(RTE_SPHINX_BUILD) -b latex $(RTE_SPHINX_VERBOSE) \
83 -c $(RTE_SDK)/doc/guides $(RTE_SDK)/doc/guides/$* \
84 $(RTE_OUTPUT)/doc/pdf/guides/$*
86 @echo 'pdflatex processing $@...'
87 $(Q)$(MAKE) all-pdf -sC $(RTE_OUTPUT)/doc/pdf/guides/$* \
88 LATEXOPTS=$(RTE_PDFLATEX_VERBOSE)
89 $(Q)mv $(RTE_OUTPUT)/doc/pdf/guides/$*/doc.pdf \
90 $(RTE_OUTPUT)/doc/pdf/guides/$*.pdf
93 $(Q)install -D -m0644 $(RTE_SDK)/doc/guides/custom.css \
94 $(RTE_OUTPUT)/doc/html/guides/_static/css/custom.css
98 guides-%: guides-%-prepare
99 @echo 'sphinx processing $@...'
100 $(Q)$(RTE_SPHINX_BUILD) -b $* $(RTE_SPHINX_VERBOSE) \
101 -c $(RTE_SDK)/doc/guides $(RTE_SDK)/doc/guides \
102 $(RTE_OUTPUT)/doc/$*/guides
104 # Each PDF depends on generated images *.pdf from *.svg
105 $(foreach guide, $(RTE_GUIDES), $(foreach img, $(wildcard $(guide)img/*.svg), \
106 $(eval guides-pdf-$(notdir $(guide:/=)): $(img:svg=pdf))))
108 $(Q)inkscape -d $(RTE_PDF_DPI) -D -f $< -A $@ $(RTE_INKSCAPE_VERBOSE)