examples/ipsec-secgw: fix GCM IV length
[dpdk.git] / mk / rte.sdkdoc.mk
1 # SPDX-License-Identifier: BSD-3-Clause
2 # Copyright(c) 2010-2015 Intel Corporation.
3 # Copyright(c) 2013-2015 6WIND S.A.
4
5 ifdef T
6 ifeq ("$(origin T)", "command line")
7 $(error "Cannot use T= with doc target")
8 endif
9 endif
10
11 RTE_SPHINX_BUILD = sphinx-build
12 RTE_PDFLATEX_VERBOSE := --interaction=nonstopmode
13
14 ifndef V
15 RTE_SPHINX_VERBOSE := -q
16 RTE_PDFLATEX_VERBOSE := --interaction=batchmode
17 RTE_INKSCAPE_VERBOSE := >/dev/null 2>&1
18 endif
19 ifeq '$V' '0'
20 RTE_SPHINX_VERBOSE := -q
21 RTE_PDFLATEX_VERBOSE := --interaction=batchmode
22 RTE_INKSCAPE_VERBOSE := >/dev/null 2>&1
23 endif
24
25 RTE_PDF_DPI ?= 300
26
27 RTE_GUIDES := $(filter %/, $(wildcard $(RTE_SDK)/doc/guides/*/))
28
29 API_EXAMPLES := $(RTE_OUTPUT)/doc/html/examples.dox
30
31 .PHONY: help
32 help:
33         @cat $(RTE_SDK)/doc/build-sdk-quick.txt
34         @$(MAKE) -rR showconfigs | sed 's,^,\t\t\t\t,'
35
36 .PHONY: all
37 all: api-html guides-html guides-pdf
38
39 .PHONY: clean
40 clean: api-html-clean guides-html-clean guides-pdf-clean guides-man-clean
41
42 .PHONY: api-html
43 api-html: $(API_EXAMPLES)
44         @echo 'doxygen for API...'
45         $(Q)mkdir -p $(RTE_OUTPUT)/doc/html
46         $(Q)(sed -e "s|@VERSION@|`$(MAKE) -rRs showversion`|" \
47                  -e "s|@API_EXAMPLES@|$(API_EXAMPLES)|"       \
48                  -e "s|@OUTPUT@|$(RTE_OUTPUT)/doc|"           \
49                  -e "s|@HTML_OUTPUT@|html/api|"               \
50                  -e "s|@TOPDIR@|./|g"                         \
51                  -e "s|@STRIP_FROM_PATH@|./|g"                \
52                  $(RTE_SDK)/doc/api/doxy-api.conf.in)|        \
53             doxygen -
54         $(Q)$(RTE_SDK)/doc/api/doxy-html-custom.sh $(RTE_OUTPUT)/doc/html/api/doxygen.css
55
56 .PHONY: api-html-clean
57 api-html-clean:
58         $(Q)rm -f $(API_EXAMPLES)
59         $(Q)rm -rf $(RTE_OUTPUT)/doc/html/api/search
60         $(Q)rm -f $(RTE_OUTPUT)/doc/html/api/*
61         $(Q)rmdir -p --ignore-fail-on-non-empty $(RTE_OUTPUT)/doc/html/api 2>&- || true
62
63 $(API_EXAMPLES): api-html-clean
64         $(Q)mkdir -p $(@D)
65         $(Q)doc/api/generate_examples.sh examples $(API_EXAMPLES)
66
67 guides-pdf-clean: guides-pdf-img-clean
68 guides-pdf-img-clean:
69         $(Q)rm -f $(RTE_SDK)/doc/guides/*/img/*.pdf
70
71 guides-%-clean:
72         $(Q)rm -rf $(RTE_OUTPUT)/doc/$*/guides
73         $(Q)rmdir -p --ignore-fail-on-non-empty $(RTE_OUTPUT)/doc/$* 2>&- || true
74
75 guides-pdf: $(addprefix guides-pdf-, $(notdir $(RTE_GUIDES:/=))) ;
76 guides-pdf-%:
77         @echo 'sphinx processing $@...'
78         $(Q)$(RTE_SPHINX_BUILD) -b latex $(RTE_SPHINX_VERBOSE) \
79                 -c $(RTE_SDK)/doc/guides $(RTE_SDK)/doc/guides/$* \
80                 $(RTE_OUTPUT)/doc/pdf/guides/$*
81         $(if $^,$(Q)rm -f $^)
82         @echo 'pdflatex processing $@...'
83         $(Q)$(MAKE) all-pdf -sC $(RTE_OUTPUT)/doc/pdf/guides/$* \
84                 LATEXOPTS=$(RTE_PDFLATEX_VERBOSE)
85         $(Q)mv $(RTE_OUTPUT)/doc/pdf/guides/$*/doc.pdf \
86                 $(RTE_OUTPUT)/doc/pdf/guides/$*.pdf
87
88 guides-html-prepare:
89         $(Q)install -D -m0644 $(RTE_SDK)/doc/guides/custom.css \
90                 $(RTE_OUTPUT)/doc/html/guides/_static/css/custom.css
91
92 guides-%-prepare: ;
93
94 guides-%: guides-%-prepare
95         @echo 'sphinx processing $@...'
96         $(Q)$(RTE_SPHINX_BUILD) -b $* $(RTE_SPHINX_VERBOSE) \
97                 -c $(RTE_SDK)/doc/guides $(RTE_SDK)/doc/guides \
98                 $(RTE_OUTPUT)/doc/$*/guides
99
100 # Each PDF depends on generated images *.pdf from *.svg
101 $(foreach guide, $(RTE_GUIDES), $(foreach img, $(wildcard $(guide)img/*.svg), \
102         $(eval guides-pdf-$(notdir $(guide:/=)): $(img:svg=pdf))))
103 %.pdf: %.svg
104         $(Q)inkscape -d $(RTE_PDF_DPI) -D -f $< -A $@ $(RTE_INKSCAPE_VERBOSE)