offlate/Makefile

Makefile

1
# Minimal makefile for Sphinx documentation
2
#
3
4
# You can set these variables from the command line.
5
SPHINXOPTS    =
6
SPHINXBUILD   = python3 -msphinx
7
SPHINXPROJ    = transmon
8
SOURCEDIR     = doc
9
BUILDDIR      = _build
10
11
# Put it first so that "make" without argument is like "make help".
12
help:
13
	@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
14
15
.PHONY: help Makefile fonts
16
17
# Catch-all target: route all unknown targets to Sphinx using the new
18
# "make mode" option.  $(O) is meant as a shortcut for $(SPHINXOPTS).
19
%: Makefile
20
	@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
21
22
upload:
23
	rm -rf dist
24
	python3 setup.py sdist
25
	gpg --detach-sign -a dist/*.tar.gz
26
	twine upload dist/*
27
28
test-upload:
29
	rm -rf dist
30
	python3 setup.py sdist
31
	gpg --detach-sign -a dist/*.tar.gz
32
	twine upload -r pypitest dist/*
33
34
update-data:
35
	python3 extractdata.py
36
37
fonts: offlate/ui/data/whitespace.ttf offlate/ui/data/whitespace-mono.ttf
38
39
# prevent sphinx from taking over this target
40
%.sfd:
41
42
%.ttf: %.sfd
43
	echo 'Open("$<")' > fontforge_whitespace
44
	echo 'Generate("$@")' >> fontforge_whitespace
45
	fontforge -lang=ff -script fontforge_whitespace
46
47
LANGS=en fr
48
49
update-langs:
50
	for l in $(LANGS); do \
51
		pylupdate5 offlate/ui/*.py offlate/ui/config/*.py offlate/systems/*.py \
52
		  -ts offlate/locales/offlate_$${l}.ts ;\
53
		lrelease offlate/locales/offlate_$${l}.ts ;\
54
	done
55
56
create-bundle-linux: update-langs
57
	pyinstaller run.py --add-data offlate/ui/data:offlate/ui/data \
58
	  --add-data offlate/data:offlate/data \
59
	  --add-data offlate/locales:offlate/locales \
60
	  --windowed -n offlate
61
	patchelf --set-rpath . dist/run/run
62
	cd dist/run; for f in *.so *.so.*; do patchelf --set-rpath . $$f; done
63
	mkdir -p dist/bin
64
	printf "#!/bin/sh\ncd \$$(dirname \$$0)/../run; exec ./run" > dist/bin/offlate
65
	chmod +x dist/bin/offlate
66
67
bundle-linux: create-bundle-linux
68
	tar cf dist/offlate-bin.tar -C dist/ run bin
69
	gzip dist/offlate-bin.tar
70
71
bundle-windows: update-langs
72
	pyinstaller run.py --add-data offlate\data;offlate\data \
73
	  --add-data offlate\ui\data;offlate\ui\data \
74
	  --add-data offlate\locales;offlate\locales \
75
	  --windowed \
76
	  --hidden-import _cffi_backend
77