This repository was archived by the owner on Jul 30, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
81 lines (58 loc) · 2.93 KB
/
Makefile
File metadata and controls
81 lines (58 loc) · 2.93 KB
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
# =============================================================================
# @file Makefile
# @brief Makefile for some steps in creating a Check It! application
# @author Michael Hucka
# @date 2019-09-05
# @license Please see the file named LICENSE in the project directory
# @website https://github.com/caltechlibrary/checkit
# =============================================================================
# Application-specific configuration ------------------------------------------
python_name := checkit
app_name := CheckIt
# Other variables (should not need changing) ----------------------------------
release := $(shell grep 'version\s*=' setup.cfg | cut -f2 -d'=' | tr -d '[:blank:]')
platform := $(shell python3 -c 'import sys; print(sys.platform)')
distro := $(shell python3 -c 'import distro; print(distro.linux_distribution(False)[0])')
linux_vers := $(shell python3 -c 'import distro; print(distro.linux_distribution(False)[1])' | cut -f1-2 -d'.')
macos_vers := $(shell sw_vers -productVersion 2>/dev/null | cut -f1-2 -d'.' || true)
github-css := dev/github-css/github-markdown-css.html
about-file := ABOUT.html
help-file := $(python_name)/data/help.html
# Main build targets ----------------------------------------------------------
build: | dependencies data-files build-$(platform)
release:;
sed -i .bak -e "/version/ s/[0-9].[0-9].[0-9]/$(release)/" codemeta.json
git add codemeta.json
git commit -m"Update version number" codemeta.json
git tag -a v$(release) -m "Release $(release)"
git push -v --all
git push -v --tags
# Platform-specific instructions ----------------------------------------------
build-darwin: $(about-file) $(help-file) dist/$(app_name).app
packagesbuild dev/installers/macos/$(app_name).pkgproj
mv dist/$(app_name).pkg dist/$(app_name)-$(release)-macos-$(macos_vers).pkg
build-linux: dist/$(python_name)
(cd dist; tar czf $(app_name)-$(release)-$(distro)-$(linux_vers).tar.gz $(python_name))
dist/$(app_name).app:
pyinstaller --clean pyinstaller-$(platform).spec
sed -i '' -e 's/0.0.0/$(release)/' dist/$(app_name).app/Contents/Info.plist
rm -f dist/$(app_name).app/Contents/Info.plist.bak
rm -f dist/$(python_name)
dependencies:;
pip3 install -r requirements.txt
data-files: $(about-file) $(help-file)
# Component files placed in the installers ------------------------------------
# Temporary link so that the generic .md -> .html rule works for ABOUT.html.
ABOUT.md: README.md
ln -s ${<F} ${@F}
%.html: %.md
pandoc --standalone --quiet -f gfm -H $(github-css) $< | inliner -n > $@
# Miscellaneous directives ----------------------------------------------------
clean: clean-dist clean-html clean-other
clean-dist:;
-rm -fr dist/$(app_name).app dist/$(app_name).pkg dist/$(python_name) build
clean-html:;
-rm -fr ABOUT.md ABOUT.html $(python_name)/data/help.html tmp.html
clean-other:;
-rm -fr $(python_name)/__pycache__
.PHONY: build build-darwin build-linux clean clean-dist clean-html