-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
122 lines (90 loc) · 2.61 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
122
#
# Minimal makefile for Sphinx documentation
#
# Version: 1.0.0
# Date: 2021-01-13
# Author: Yves Vindevogel (vindevoy)
#
#
# You can set these variables from the command line, and also
# from the environment for the first two.
#
SHELL=/bin/bash
SPHINXOPTS ?=
SPHINXBUILD ?= sphinx-build
SOURCEDIR = source
BUILDDIR = build
IMAGE_REPO=vindevoy
IMAGE_NAME=zythologie-eindwerk
IMAGE_VERSION=2021.01.30
.PHONY: help Makefile
#
# Put help as first task so that "make" without argument is like "make help".
#
help:
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
#
# watch checks all the files in source and if there's a change to a file,
# it rebuilds the html.
#
watch:
@./watch.sh &
#
# Simple pass-through but useful for dependencies
#
html:
@$(SPHINXBUILD) -M html "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
latexpdf:
@$(SPHINXBUILD) -M latexpdf "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
#
# Avoid common mistake
#
pdf:
@$(SPHINXBUILD) -M latexpdf "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
#
# Docker commands
#
build: clean html
@docker build -t $(IMAGE_REPO)/$(IMAGE_NAME):$(IMAGE_VERSION) -f docker/Dockerfile .
run:
@docker run -it -p 80:80 -d --name $(IMAGE_NAME) $(IMAGE_REPO)/$(IMAGE_NAME):$(IMAGE_VERSION)
stop:
@docker stop $(IMAGE_NAME)
tag: build
docker tag $(IMAGE_REPO)/$(IMAGE_NAME):$(IMAGE_VERSION) $(IMAGE_REPO)/$(IMAGE_NAME):latest
publish: tag
docker push $(IMAGE_REPO)/$(IMAGE_NAME):$(IMAGE_VERSION)
docker push $(IMAGE_REPO)/$(IMAGE_NAME):latest
remove:
$(eval ic=$(shell docker images | grep '$(IMAGE_REPO)/$(IMAGE_NAME)' | wc -l))
@if [[ "$(ic)" -ne 0 ]]; then docker images | grep '$(IMAGE_REPO)/$(IMAGE_NAME)' | \
sed 's/ */ /g' | cut -d ' ' -f3 | xargs docker image remove --force; fi
prune:
docker system prune -f
#
# 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)
#
# Install packages for Linux Mint (Ubuntu ?)
#
pre-install-mint-linux:
sudo apt-get install entr
sudo apt-get install latexmk
sudo apt-get install texlive-latex-recommended
sudo apt-get install texlive-latex-extra
sudo apt-get install texlive-lang-european
#
# Installation using conda (conda must be installed)
#
# Note: You must be using the proper conda environment each time
# you use this Makefile. To do so, use "conda activate sphinx".
#
install-sphinx:
conda create --name sphinx
conda activate sphinx
conda install python
conda install sphinx
conda install sphinx_rtd_theme