File: Makefile

package info (click to toggle)
paperwork 1.3.1-3
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 11,060 kB
  • sloc: python: 19,833; makefile: 470; sh: 274; xml: 114
file content (154 lines) | stat: -rw-r--r-- 3,833 bytes parent folder | download
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
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
# order matters (dependencies)
ALL_COMPONENTS = paperwork-backend paperwork-gtk

build: $(ALL_COMPONENTS:%=%_build)

clean: $(ALL_COMPONENTS:%=%_clean)
	rm -rf build dist
	rm -rf venv
	make -C sub/libinsane clean || true
	make -C sub/libpillowfight clean || true
	make -C sub/pyocr clean || true

install: $(ALL_COMPONENTS:%=%_install)

install_py: $(ALL_COMPONENTS:%=%_install_py)

install_c: $(ALL_COMPONENTS:%=%_install_c)

uninstall: $(ALL_COMPONENTS:%=%_uninstall)

uninstall_py: $(ALL_COMPONENTS:%=%_uninstall_py)

uninstall_c: $(ALL_COMPONENTS:%=%_uninstall_c)

version: $(ALL_COMPONENTS:%=%_version)

check: $(ALL_COMPONENTS:%=%_check)

test: $(ALL_COMPONENTS:%=%_test)

doc: $(ALL_COMPONENTS:%=%_doc)

release_pypi: $(ALL_COMPONENTS:%=%_release_pypi)

release: $(ALL_COMPONENTS:%=%_release)
ifeq (${RELEASE}, )
	@echo "You must specify a release version (make release RELEASE=1.2.3)"
else
	@echo "Will release: ${RELEASE}"
	git tag -a ${RELEASE} -m ${RELEASE}
	git push origin ${RELEASE}
	make clean
	make version
	make release_pypi
	@echo "All done"
	@echo "IMPORTANT: Don't forgot to add the latest release on Flathub !"
endif

linux_exe: $(ALL_COMPONENTS:%=%_linux_exe)

libinsane_win32:
	${MAKE} -C sub/libinsane install PREFIX=/mingw32

pyocr_win32:
	${MAKE} -C sub/pyocr install

libpillowfight_win32:
	${MAKE} -C sub/libpillowfight install_py

windows_exe: $(ALL_COMPONENTS:%=%_windows_exe)
	mkdir -p dist
	(cd build/exe ; zip -r ../../dist/paperwork.zip *)

help:
	@echo "make build: run 'python3 ./setup.py build' in all components"
	@echo "make clean"
	@echo "make help: display this message"
	@echo "make install : run 'python3 ./setup.py install' on all components"
	@echo "make release"
	@echo "make uninstall : run 'pip3 uninstall -y (component)' on all components"
	@echo "Components:" ${ALL_COMPONENTS}

%_version:
	echo "Making version file $(@:%_version=%)"
	$(MAKE) -C $(@:%_version=%) version

%_check:
	echo "Checking $(@:%_check=%)"
	$(MAKE) -C $(@:%_check=%) check

%_test:
	echo "Checking $(@:%_test=%)"
	$(MAKE) -C $(@:%_test=%) test

%_doc:
	echo "Checking $(@:%_doc=%)"
	$(MAKE) -C $(@:%_doc=%) doc

%_build:
	echo "Building $(@:%_build=%)"
	$(MAKE) -C $(@:%_build=%) build

%_clean:
	echo "Building $(@:%_clean=%)"
	$(MAKE) -C $(@:%_clean=%) clean

%_install:
	echo "Installing $(@:%_install=%)"
	$(MAKE) -C $(@:%_install=%) install

%_build_py:
	echo "Building $(@:%_build_py=%)"
	$(MAKE) -C $(@:%_build=%) build_py

%_install_py:
	echo "Installing $(@:%_install_py=%)"
	$(MAKE) -C $(@:%_build=%) install_py

%_build_c:
	echo "Building $(@:%_build_c=%)"
	$(MAKE) -C $(@:%_build=%) build_c

%_install_c:
	echo "Installing $(@:%_install_c=%)"
	$(MAKE) -C $(@:%_build=%) install_c

%_uninstall:
	echo "Uninstalling $(@:%_uninstall=%)"
	$(MAKE) -C $(@:%_uninstall=%) uninstall

%_uninstall_py:
	echo "Uninstalling $(@:%_uninstall_py=%)"
	$(MAKE) -C $(@:%_uninstall=%) uninstall_py

%_uninstall_c:
	echo "Uninstalling $(@:%_uninstall_c=%)"
	$(MAKE) -C $(@:%_uninstall=%) uninstall_c

%_release:
	echo "Releasing $(@:%_release=%)"
	$(MAKE) -C $(@:%_release=%) release

%_release_pypi:
	echo "Releasing $(@:%_release_pypi=%)"
	$(MAKE) -C $(@:%_release_pypi=%) release_pypi

%_linux_exe:
	echo "Building Linux exe for $(@:%_linux_exe=%)"
	$(MAKE) -C $(@:%_linux_exe=%) linux_exe

%_windows_exe: version libinsane_win32 pyocr_win32 libpillowfight_win32
	echo "Building Windows exe for $(@:%_windows_exe=%)"
	$(MAKE) -C $(@:%_windows_exe=%) windows_exe

venv:
	echo "Building virtual env"
	git submodule init
	git submodule update --recursive --remote --init
	make -C sub/libinsane build_c
	virtualenv -p python3 --system-site-packages venv

.PHONY: help build clean test check install install_py install_c uninstall \
	uninstall_c uninstall_py release libinsane_win32 pyocr_win32 \
	libpillowfight_win32