2018-05-03 07:30:11 +00:00
|
|
|
# SPDX-License-Identifier: BSD-3-Clause
|
|
|
|
# Copyright(c) 2010-2015 Intel Corporation.
|
|
|
|
# Copyright(c) 2013-2015 6WIND S.A.
|
2012-09-04 12:54:00 +00:00
|
|
|
|
|
|
|
ifdef T
|
|
|
|
ifeq ("$(origin T)", "command line")
|
|
|
|
$(error "Cannot use T= with doc target")
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
|
2014-10-15 20:12:20 +00:00
|
|
|
RTE_SPHINX_BUILD = sphinx-build
|
2015-02-03 14:11:14 +00:00
|
|
|
RTE_PDFLATEX_VERBOSE := --interaction=nonstopmode
|
|
|
|
|
2014-10-15 20:12:20 +00:00
|
|
|
ifndef V
|
|
|
|
RTE_SPHINX_VERBOSE := -q
|
2015-02-03 14:11:14 +00:00
|
|
|
RTE_PDFLATEX_VERBOSE := --interaction=batchmode
|
|
|
|
RTE_INKSCAPE_VERBOSE := >/dev/null 2>&1
|
2014-10-15 20:12:20 +00:00
|
|
|
endif
|
|
|
|
ifeq '$V' '0'
|
|
|
|
RTE_SPHINX_VERBOSE := -q
|
2015-02-03 14:11:14 +00:00
|
|
|
RTE_PDFLATEX_VERBOSE := --interaction=batchmode
|
|
|
|
RTE_INKSCAPE_VERBOSE := >/dev/null 2>&1
|
2014-10-15 20:12:20 +00:00
|
|
|
endif
|
|
|
|
|
2015-02-03 14:11:14 +00:00
|
|
|
RTE_PDF_DPI ?= 300
|
|
|
|
|
|
|
|
RTE_GUIDES := $(filter %/, $(wildcard $(RTE_SDK)/doc/guides/*/))
|
|
|
|
|
2017-02-08 17:54:55 +00:00
|
|
|
API_EXAMPLES := $(RTE_OUTPUT)/doc/html/examples.dox
|
|
|
|
|
2013-05-07 13:46:58 +00:00
|
|
|
.PHONY: help
|
|
|
|
help:
|
|
|
|
@cat $(RTE_SDK)/doc/build-sdk-quick.txt
|
|
|
|
@$(MAKE) -rR showconfigs | sed 's,^,\t\t\t\t,'
|
|
|
|
|
2013-04-19 10:34:40 +00:00
|
|
|
.PHONY: all
|
2015-02-03 14:11:14 +00:00
|
|
|
all: api-html guides-html guides-pdf
|
2012-09-04 12:54:00 +00:00
|
|
|
|
2013-04-19 10:34:40 +00:00
|
|
|
.PHONY: clean
|
2016-08-31 07:50:10 +00:00
|
|
|
clean: api-html-clean guides-html-clean guides-pdf-clean guides-man-clean
|
2013-04-19 10:34:40 +00:00
|
|
|
|
2014-10-15 19:28:13 +00:00
|
|
|
.PHONY: api-html
|
2017-04-06 10:44:33 +00:00
|
|
|
api-html: $(API_EXAMPLES)
|
2013-04-19 10:34:40 +00:00
|
|
|
@echo 'doxygen for API...'
|
|
|
|
$(Q)mkdir -p $(RTE_OUTPUT)/doc/html
|
2014-10-15 19:43:41 +00:00
|
|
|
$(Q)(cat $(RTE_SDK)/doc/api/doxy-api.conf && \
|
2013-07-19 14:06:26 +00:00
|
|
|
printf 'PROJECT_NUMBER = ' && \
|
2017-06-23 18:41:46 +00:00
|
|
|
$(MAKE) -rRs showversion && \
|
2017-02-08 17:54:55 +00:00
|
|
|
echo INPUT += $(API_EXAMPLES) && \
|
2013-04-19 10:34:40 +00:00
|
|
|
echo OUTPUT_DIRECTORY = $(RTE_OUTPUT)/doc && \
|
|
|
|
echo HTML_OUTPUT = html/api && \
|
|
|
|
echo GENERATE_HTML = YES && \
|
|
|
|
echo GENERATE_LATEX = NO && \
|
|
|
|
echo GENERATE_MAN = NO )| \
|
|
|
|
doxygen -
|
2014-10-15 19:43:41 +00:00
|
|
|
$(Q)$(RTE_SDK)/doc/api/doxy-html-custom.sh $(RTE_OUTPUT)/doc/html/api/doxygen.css
|
2013-04-19 10:34:40 +00:00
|
|
|
|
2014-10-15 19:28:13 +00:00
|
|
|
.PHONY: api-html-clean
|
|
|
|
api-html-clean:
|
2017-04-06 10:44:33 +00:00
|
|
|
$(Q)rm -f $(API_EXAMPLES)
|
2014-10-15 16:51:10 +00:00
|
|
|
$(Q)rm -f $(RTE_OUTPUT)/doc/html/api/*
|
2013-04-19 10:34:40 +00:00
|
|
|
$(Q)rmdir -p --ignore-fail-on-non-empty $(RTE_OUTPUT)/doc/html/api 2>&- || true
|
2014-10-15 20:12:20 +00:00
|
|
|
|
2017-04-06 10:44:33 +00:00
|
|
|
$(API_EXAMPLES): api-html-clean
|
|
|
|
$(Q)mkdir -p $(@D)
|
2018-09-11 20:42:33 +00:00
|
|
|
$(Q)doc/api/generate_examples.sh examples $(API_EXAMPLES)
|
2017-02-08 17:54:55 +00:00
|
|
|
|
2015-02-03 14:11:14 +00:00
|
|
|
guides-pdf-clean: guides-pdf-img-clean
|
|
|
|
guides-pdf-img-clean:
|
|
|
|
$(Q)rm -f $(RTE_SDK)/doc/guides/*/img/*.pdf
|
|
|
|
|
2015-04-01 11:32:45 +00:00
|
|
|
guides-%-clean:
|
|
|
|
$(Q)rm -rf $(RTE_OUTPUT)/doc/$*/guides
|
|
|
|
$(Q)rmdir -p --ignore-fail-on-non-empty $(RTE_OUTPUT)/doc/$* 2>&- || true
|
2015-02-03 14:11:14 +00:00
|
|
|
|
2015-04-01 11:32:45 +00:00
|
|
|
guides-pdf: $(addprefix guides-pdf-, $(notdir $(RTE_GUIDES:/=))) ;
|
2015-02-03 14:11:14 +00:00
|
|
|
guides-pdf-%:
|
|
|
|
@echo 'sphinx processing $@...'
|
|
|
|
$(Q)$(RTE_SPHINX_BUILD) -b latex $(RTE_SPHINX_VERBOSE) \
|
|
|
|
-c $(RTE_SDK)/doc/guides $(RTE_SDK)/doc/guides/$* \
|
|
|
|
$(RTE_OUTPUT)/doc/pdf/guides/$*
|
2015-04-02 16:14:23 +00:00
|
|
|
$(if $^,$(Q)rm -f $^)
|
2015-02-03 14:11:14 +00:00
|
|
|
@echo 'pdflatex processing $@...'
|
|
|
|
$(Q)$(MAKE) all-pdf -sC $(RTE_OUTPUT)/doc/pdf/guides/$* \
|
|
|
|
LATEXOPTS=$(RTE_PDFLATEX_VERBOSE)
|
|
|
|
$(Q)mv $(RTE_OUTPUT)/doc/pdf/guides/$*/doc.pdf \
|
|
|
|
$(RTE_OUTPUT)/doc/pdf/guides/$*.pdf
|
|
|
|
|
2018-02-12 17:13:44 +00:00
|
|
|
guides-html-prepare:
|
|
|
|
$(Q)install -D -m0644 $(RTE_SDK)/doc/guides/custom.css \
|
|
|
|
$(RTE_OUTPUT)/doc/html/guides/_static/css/custom.css
|
|
|
|
|
|
|
|
guides-%-prepare: ;
|
|
|
|
|
|
|
|
guides-%: guides-%-prepare
|
2015-04-01 11:32:45 +00:00
|
|
|
@echo 'sphinx processing $@...'
|
|
|
|
$(Q)$(RTE_SPHINX_BUILD) -b $* $(RTE_SPHINX_VERBOSE) \
|
|
|
|
-c $(RTE_SDK)/doc/guides $(RTE_SDK)/doc/guides \
|
|
|
|
$(RTE_OUTPUT)/doc/$*/guides
|
|
|
|
|
2015-02-03 14:11:14 +00:00
|
|
|
# Each PDF depends on generated images *.pdf from *.svg
|
|
|
|
$(foreach guide, $(RTE_GUIDES), $(foreach img, $(wildcard $(guide)img/*.svg), \
|
|
|
|
$(eval guides-pdf-$(notdir $(guide:/=)): $(img:svg=pdf))))
|
|
|
|
%.pdf: %.svg
|
|
|
|
$(Q)inkscape -d $(RTE_PDF_DPI) -D -f $< -A $@ $(RTE_INKSCAPE_VERBOSE)
|