-
Notifications
You must be signed in to change notification settings - Fork 47
/
Makefile
121 lines (101 loc) · 3.97 KB
/
Makefile
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
# Makefile for Sphinx documentation
# Run all targets sequentially (disable parallel jobs)
# See: https://www.gnu.org/software/make/manual/html_node/Parallel.html
.NOTPARALLEL:
# Run all commands in the same shell (disable one shell per command)
# See: https://www.gnu.org/software/make/manual/html_node/One-Shell.html
.ONESHELL:
.PHONY: help init langdoc Makefile*
# Use Bash shell for commands.
SHELL := /bin/bash
# Check required features
ifeq ($(filter oneshell,$(.FEATURES)),)
$(error This Make doesn't support '.ONESHELL', use Make >= 3.82)
endif
# You can set these variables from the command line.
# Adding more '-v' increases the log verbosity level.
SPHINXBUILD := sphinx-build
SPHINXOPTS := -v
SPHINXPROJ := Kurento
MAVEN := mvn
MAVEN_ARGS := --batch-mode
BUILD := build
DIST := dist
DIST_NAME := kurento-doc
LANGDOC := langdoc
SOURCE := source
DIST_PATH := $(CURDIR)/$(DIST)/$(DIST_NAME)
LANGDOC_PATH := $(CURDIR)/$(BUILD)/$(LANGDOC)
SPHINX_SRC_PATH := $(CURDIR)/$(BUILD)/$(SOURCE)
# Fully-qualified plugin names, to use newer versions than the Maven defaults.
MAVEN_JAVADOC_PLUGIN := org.apache.maven.plugins:maven-javadoc-plugin:3.5.0
# Put this target first so that "make" without argument is like "make help"
help:
@$(SPHINXBUILD) -M $@ "$(SOURCE)" "$(BUILD)" $(SPHINXOPTS) $(O)
@echo " langdoc to make JavaDoc and JsDoc of the Kurento Clients"
@echo " dist to make <langdoc html epub latexpdf> and then pack"
@echo " all resulting files as $(DIST_NAME).tgz"
@echo " readthedocs to make <langdoc> and then copy the results to the"
@echo " Sphinx theme's static folder"
@echo ""
@echo "apt-get dependencies:"
@echo "- make >= 3.82"
@echo "- javadoc (default-jdk-headless)"
@echo "- npm"
@echo "- latexmk"
@echo "- texlive-fonts-recommended"
@echo "- texlive-latex-recommended"
@echo "- texlive-latex-extra"
init:
mkdir -p \
$(DIST_PATH) \
$(LANGDOC_PATH) \
$(SPHINX_SRC_PATH)
rsync -a $(SOURCE)/ $(SPHINX_SRC_PATH)/
./configure.sh --source $(SPHINX_SRC_PATH)
langdoc-client-java:
pushd ../clients/java/client/ || { echo "ERROR: 'cd' failed"; exit 1; }
$(MAVEN) $(MAVEN_ARGS) -Psnapshot -DskipTests=true clean package \
|| { echo "ERROR: '$(MAVEN) clean package' failed"; exit 1; }
$(MAVEN) $(MAVEN_ARGS) -Psnapshot $(MAVEN_JAVADOC_PLUGIN):javadoc \
-DreportOutputDirectory="$(LANGDOC_PATH)" \
-DdestDir="client-javadoc" \
-Dsourcepath="src/main/java:target/generated-sources/kmd" \
-Dsubpackages="org.kurento.client" \
-DexcludePackageNames="*.internal:*.internal.*:*.internal.*.*" \
|| { echo "ERROR: '$(MAVEN) javadoc' failed"; exit 1; }
popd
langdoc-client-js:
pushd ../clients/javascript/client/ || { echo "ERROR: 'cd' failed"; exit 1; }
npm install
node_modules/.bin/grunt --no-color --force jsdoc \
|| { echo "ERROR: 'grunt jsdoc' failed"; exit 1; }
rsync -a doc/jsdoc/ $(LANGDOC_PATH)/client-jsdoc/
popd
langdoc-utils-js:
pushd ../browser/kurento-utils-js/ || { echo "ERROR: 'cd' failed"; exit 1; }
npm install
node_modules/.bin/grunt --no-color --force jsdoc \
|| { echo "ERROR: 'grunt jsdoc' failed"; exit 1; }
rsync -a doc/jsdoc/kurento-utils/*/ $(LANGDOC_PATH)/utils-jsdoc/
popd
langdoc: init langdoc-client-java langdoc-client-js langdoc-utils-js
dist: langdoc html epub latexpdf
rsync -a \
$(BUILD)/html \
$(BUILD)/epub/Kurento.epub \
$(BUILD)/latex/Kurento.pdf \
$(DIST_PATH)/
tar zcf $(DIST_PATH).tgz -C $(DIST_PATH) .
# Target to be run by CI.
# It modifies the source directory, adding the langdoc results, so the worspace
# should get cleaned up or deleted afterwards by the CI job.
ci-readthedocs: langdoc
rsync -a $(SPHINX_SRC_PATH)/ $(SOURCE)/
rsync -a $(BUILD)/langdoc $(SOURCE)/
# Comment this target to disable unconditional generation of JavaDoc & JsDoc
#html: langdoc
# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%: init Makefile*
$(SPHINXBUILD) -M $@ "$(SPHINX_SRC_PATH)" "$(BUILD)" $(SPHINXOPTS) $(O)