Harald Welte | 94e8735 | 2021-04-02 13:38:00 +0200 | [diff] [blame] | 1 | # 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. |
| 6 | SPHINXOPTS ?= |
| 7 | SPHINXBUILD ?= sphinx-build |
| 8 | SOURCEDIR = . |
| 9 | BUILDDIR = _build |
| 10 | |
Harald Welte | e4759fd | 2021-04-11 10:58:30 +0200 | [diff] [blame] | 11 | # for osmo-gsm-manuals |
Oliver Smith | 0529c19 | 2022-10-21 16:03:53 +0200 | [diff] [blame] | 12 | OSMO_GSM_MANUALS_DIR ?= $(shell pkg-config osmo-gsm-manuals --variable=osmogsmmanualsdir 2>/dev/null) |
Harald Welte | e4759fd | 2021-04-11 10:58:30 +0200 | [diff] [blame] | 13 | OSMO_REPOSITORY = "pysim" |
| 14 | UPLOAD_FILES = $(BUILDDIR)/latex/osmopysim-usermanual.pdf |
| 15 | CLEAN_FILES = $(UPLOAD_FILES) |
| 16 | |
Oliver Smith | da1f562 | 2023-03-07 12:44:14 +0100 | [diff] [blame^] | 17 | # Copy variables from Makefile.common.inc that are used in publish-html, |
| 18 | # as Makefile.common.inc must be included after publish-html |
| 19 | PUBLISH_REF ?= master |
| 20 | PUBLISH_TEMPDIR = _publish_tmpdir |
| 21 | SSH_COMMAND = ssh -o 'UserKnownHostsFile=$(OSMO_GSM_MANUALS_DIR)/build/known_hosts' -p 48 |
| 22 | |
Harald Welte | 94e8735 | 2021-04-02 13:38:00 +0200 | [diff] [blame] | 23 | # Put it first so that "make" without argument is like "make help". |
Harald Welte | e4759fd | 2021-04-11 10:58:30 +0200 | [diff] [blame] | 24 | .PHONY: help |
Harald Welte | 94e8735 | 2021-04-02 13:38:00 +0200 | [diff] [blame] | 25 | help: |
| 26 | @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) |
| 27 | |
Harald Welte | e4759fd | 2021-04-11 10:58:30 +0200 | [diff] [blame] | 28 | $(BUILDDIR)/latex/pysim.pdf: latexpdf |
| 29 | @/bin/true |
| 30 | |
Harald Welte | 362d2d0 | 2022-02-09 21:01:00 +0100 | [diff] [blame] | 31 | publish-html: html |
Oliver Smith | da1f562 | 2023-03-07 12:44:14 +0100 | [diff] [blame^] | 32 | 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 Welte | 362d2d0 | 2022-02-09 21:01:00 +0100 | [diff] [blame] | 42 | |
Harald Welte | e4759fd | 2021-04-11 10:58:30 +0200 | [diff] [blame] | 43 | # put this before the catch-all below |
| 44 | include $(OSMO_GSM_MANUALS_DIR)/build/Makefile.common.inc |
| 45 | |
Harald Welte | 94e8735 | 2021-04-02 13:38:00 +0200 | [diff] [blame] | 46 | |
| 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 Welte | e4759fd | 2021-04-11 10:58:30 +0200 | [diff] [blame] | 49 | %: |
Harald Welte | 94e8735 | 2021-04-02 13:38:00 +0200 | [diff] [blame] | 50 | @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) |