File: Makefile

package info (click to toggle)
casadi 3.7.0%2Bds2-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 19,964 kB
  • sloc: cpp: 114,229; python: 35,462; xml: 1,946; ansic: 859; makefile: 257; sh: 114; f90: 63; perl: 9
file content (40 lines) | stat: -rw-r--r-- 1,602 bytes parent folder | download
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
# Minimal makefile for Sphinx documentation
#

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

EXPRESSIONS != grep DECL ../../../swig/casadi.i | grep -o -P "(?<=casadi_)\w*?(?=\()" | sort -u | paste -sd "," -

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

.PHONY: help Makefile bare_body bare_toc

# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option.  $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile
	@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)


bare_body:
	sed 's/@@EXPRESSIONS@@/  :members: $(EXPRESSIONS)/g' source/api.rst.in > source/api.rst
	rm -rf build
	make singlehtml SPHINXOPTS="-D html_theme=bare_body "
	sed -i 's/{{</{\&lbrace;</g' build/singlehtml/index.html
	sed -i 's/>}}/>}\&rbrace;/g' build/singlehtml/index.html
	mkdir -p ../../../web/content/python-api
	echo "---\n---\n" > ../../../web/content/python-api/_index.html
	cat build/singlehtml/index.html >> ../../../web/content/python-api/_index.html

bare_toc:
	sed 's/@@EXPRESSIONS@@//g' source/api.rst.in > source/api.rst
	make singlehtml SPHINXOPTS="-D html_theme=bare_body -D 'html_theme_options.mode=toc'"
	sed -i 's/index\.html//g' build/singlehtml/index.html
	mkdir -p ../../../web/themes/casadi-theme/layouts/partials/
	cat build/singlehtml/index.html > ../../../web/themes/casadi-theme/layouts/partials/python-api-sidebar.html