Makefile (1062B)
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 := source 9 BUILDDIR := build 10 11 #Own Settings 12 PORT ?= 2000 13 HOST ?= 0.0.0.0 14 BROWSER ?= xdg-open 15 16 # Put it first so that "make" without argument is like "make help". 17 help: 18 @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) 19 20 .PHONY: help Makefile 21 22 # Catch-all target: route all unknown targets to Sphinx using the new 23 # "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). 24 %: Makefile 25 @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) 26 27 28 .PHONY: installRequirements livehtml 29 30 installRequirements: 31 pip install -r requirements.txt 32 33 34 livehtml: 35 @echo "Start sphinx-autobuild at http://$(HOST):$(PORT)" 36 @trap 'kill $$PID' INT; \ 37 sphinx-autobuild $(SOURCEDIR) $(BUILDDIR)/html --host $(HOST) --port $(PORT) & \ 38 PID=$$!; \ 39 sleep 1; \ 40 xdg-open http://$(HOST):$(PORT); \ 41 wait $$PID