aboutsummaryrefslogtreecommitdiffstats
path: root/docs/Makefile
blob: 4e8f1634b212a8d6469e9c1e2f010de36d4d6a80 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
# Minimal makefile for Sphinx documentation
#
# We support MacOS for docs generation
ifeq ($(shell uname),Darwin)
OS_ID = darwin
endif

# Work out the OS if we haven't already
OS_ID ?= $(shell grep '^ID=' /etc/os-release | cut -f2- -d= | sed -e 's/\"//g')

DOC_DEB_DEPENDS = enchant libenchant-dev
DOC_RPM_DEPENDS = enchant libenchant-dev


# You can set these variables from the command line.
SPHINXOPTS    =
SPHINXBUILD   = sphinx-build
SPHINXPROJ    = fdio-vpp
SOURCEDIR     = .
BUILDDIR      = _build

# Put it first so that "make" without argument is like "make help".
help:
	@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

.PHONY: help Makefile

# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option.  $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile
	@echo "Checking whether dependencies for Docs are installed..."
ifeq ($(OS_ID),ubuntu)
	@set -e; inst=; \
		for i in $(DOC_DEB_DEPENDS); do \
			dpkg-query --show $$i >/dev/null 2>&1 || inst="$$inst $$i"; \
		done; \
		if [ "$$inst" ]; then \
			sudo apt-get update; \
			sudo apt-get $(CONFIRM) $(FORCE) install $$inst; \
		fi
else ifneq ("$(wildcard /etc/redhat-release)","")
	@sudo yum install $(CONFIRM) $(DOC_RPM_DEPENDS)
endif
# Disable spell checking for now
#	@python3 -m pip install sphinxcontrib-spelling
#	@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" -W -b spelling  $(O)
	@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
rb_node_index_t root; /**< root index */ } rb_tree_t; typedef int (*rb_tree_lt_fn) (u32 a, u32 b); void rb_tree_init (rb_tree_t * rt); rb_node_index_t rb_tree_add (rb_tree_t * rt, u32 key); rb_node_index_t rb_tree_add2 (rb_tree_t * rt, u32 key, uword opaque); rb_node_index_t rb_tree_add_custom (rb_tree_t * rt, u32 key, uword opaque, rb_tree_lt_fn ltfn); void rb_tree_del (rb_tree_t * rt, u32 key); void rb_tree_del_node (rb_tree_t * rt, rb_node_t * z); void rb_tree_del_custom (rb_tree_t * rt, u32 key, rb_tree_lt_fn ltfn); void rb_tree_free_nodes (rb_tree_t * rt); u32 rb_tree_n_nodes (rb_tree_t * rt); rb_node_t *rb_tree_min_subtree (rb_tree_t * rt, rb_node_t * x); rb_node_t *rb_tree_max_subtree (rb_tree_t * rt, rb_node_t * x); rb_node_t *rb_tree_search_subtree (rb_tree_t * rt, rb_node_t * x, u32 key); rb_node_t *rb_tree_search_subtree_custom (rb_tree_t * rt, rb_node_t * x, u32 key, rb_tree_lt_fn ltfn); rb_node_t *rb_tree_successor (rb_tree_t * rt, rb_node_t * x); rb_node_t *rb_tree_predecessor (rb_tree_t * rt, rb_node_t * x); int rb_tree_is_init (rb_tree_t * rt); static inline rb_node_index_t rb_node_index (rb_tree_t * rt, rb_node_t * n) { return n - rt->nodes; } static inline u8 rb_node_is_tnil (rb_tree_t * rt, rb_node_t * n) { return rb_node_index (rt, n) == RBTREE_TNIL_INDEX; } static inline rb_node_t * rb_node (rb_tree_t * rt, rb_node_index_t ri) { return pool_elt_at_index (rt->nodes, ri); } static inline rb_node_t * rb_node_right (rb_tree_t * rt, rb_node_t * n) { return pool_elt_at_index (rt->nodes, n->right); } static inline rb_node_t * rb_node_left (rb_tree_t * rt, rb_node_t * n) { return pool_elt_at_index (rt->nodes, n->left); } static inline rb_node_t * rb_node_parent (rb_tree_t * rt, rb_node_t * n) { return pool_elt_at_index (rt->nodes, n->parent); } #endif /* SRC_VPPINFRA_RBTREE_H_ */ /* * fd.io coding-style-patch-verification: ON * * Local Variables: * eval: (c-set-style "gnu") * End: */