blob: 3b99b250e755af88f07098429d6d8b889ac3e9fe [file] [log] [blame]
Harald Welte94e87352021-04-02 13:38:00 +02001# Minimal makefile for Sphinx documentation
2#
3
4# You can set these variables from the command line, and also
5# from the environment for the first two.
6SPHINXOPTS ?=
7SPHINXBUILD ?= sphinx-build
8SOURCEDIR = .
9BUILDDIR = _build
10
Harald Weltee4759fd2021-04-11 10:58:30 +020011# for osmo-gsm-manuals
Oliver Smith0529c192022-10-21 16:03:53 +020012OSMO_GSM_MANUALS_DIR ?= $(shell pkg-config osmo-gsm-manuals --variable=osmogsmmanualsdir 2>/dev/null)
Harald Weltee4759fd2021-04-11 10:58:30 +020013OSMO_REPOSITORY = "pysim"
14UPLOAD_FILES = $(BUILDDIR)/latex/osmopysim-usermanual.pdf
15CLEAN_FILES = $(UPLOAD_FILES)
16
Oliver Smithda1f5622023-03-07 12:44:14 +010017# Copy variables from Makefile.common.inc that are used in publish-html,
18# as Makefile.common.inc must be included after publish-html
19PUBLISH_REF ?= master
20PUBLISH_TEMPDIR = _publish_tmpdir
21SSH_COMMAND = ssh -o 'UserKnownHostsFile=$(OSMO_GSM_MANUALS_DIR)/build/known_hosts' -p 48
22
Harald Welte94e87352021-04-02 13:38:00 +020023# Put it first so that "make" without argument is like "make help".
Harald Weltee4759fd2021-04-11 10:58:30 +020024.PHONY: help
Harald Welte94e87352021-04-02 13:38:00 +020025help:
26 @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
27
Harald Weltee4759fd2021-04-11 10:58:30 +020028$(BUILDDIR)/latex/pysim.pdf: latexpdf
29 @/bin/true
30
Harald Welte362d2d02022-02-09 21:01:00 +010031publish-html: html
Oliver Smithda1f5622023-03-07 12:44:14 +010032 rm -rf "$(PUBLISH_TEMPDIR)"
33 mkdir -p "$(PUBLISH_TEMPDIR)/pysim/$(PUBLISH_REF)"
34 cp -r "$(BUILDDIR)"/html "$(PUBLISH_TEMPDIR)/pysim/$(PUBLISH_REF)"
35 cd "$(PUBLISH_TEMPDIR)" && \
36 rsync \
37 -avzR \
38 -e "$(SSH_COMMAND)" \
39 "pysim" \
40 docs@ftp.osmocom.org:web-files/
41 rm -rf "$(PUBLISH_TEMPDIR)"
Harald Welte362d2d02022-02-09 21:01:00 +010042
Harald Weltee4759fd2021-04-11 10:58:30 +020043# put this before the catch-all below
44include $(OSMO_GSM_MANUALS_DIR)/build/Makefile.common.inc
45
Harald Welte94e87352021-04-02 13:38:00 +020046
47# Catch-all target: route all unknown targets to Sphinx using the new
48# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
Harald Weltee4759fd2021-04-11 10:58:30 +020049%:
Oliver Smith308d7cd2023-03-20 12:23:36 +010050 @if [ "$@" != "shrink" ]; then \
51 $(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O); \
52 fi