Debian Codegraph @

Makefile

raw symbols SCIP
1
2
3 all:
4 @echo Targets:
5 @echo test - run tests
6 @echo pot - regenerate qbzr.pot translations template
7 @echo mo - build binary translations
8 @echo clean - remove build products
9 @echo tags - collect tags with ctags utility
10 @echo docs - build htmls for texts in docs/ directory
11 @echo epydoc - build API docs with epydoc
12 @echo ui - compile UI files
13 @echo inno - compile exe - pass RELEASE=X.Y.Z
14 @echo
15 @echo To build release run:
16 @echo make release
17 @echo the version will be picked up from version.txt
18 @echo MAKE SURE YOU COMMIT FIRST - brz export USES THE COMMITTED FILES
19
20 # We'll read the RELEASE number from version.txt
21
22 .PHONY: test pot mo clean tags docs ui
23
24 # Making pot files is disabled for now - no translators!
25 # pot:
26 # python3 setup.py build_pot -N -d.
27 RELEASE:=$(shell cat version.txt)
28
29 .check-env-vars:
30 $(info Building QBzr version ${RELEASE})
31
32 mo:
33 python3 setup.py build_mo -f --verbose
34
35 tarball: .check-env-vars
36 brz export --root=qbrz qbrz-$(RELEASE).tar.gz
37 rm -f qbrz-$(RELEASE).tar.gz.asc
38 # gpg2 -ab qbrz-$(RELEASE).tar.gz
39
40 # RJL needs to come back in
41 # inno: mo
42 # ./iscc installer/qbrz-setup.iss
43 # gpg -ab qbrz-setup-$(RELEASE).exe
44 inno: .check-env-vars
45 ./iscc installer/qbrz-setup.iss /DVersion=$(RELEASE)
46 rm -f qbrz-setup-$(RELEASE).exe.asc
47 gpg2 -ab qbrz-setup-$(RELEASE).exe
48
49 # release: tarball inno
50 release: tarball inno
51
52 clean:
53 python3 ./setup.py clean -a
54
55 tags:
56 ctags *.py lib/*.py lib/extra/*.py lib/tests/*.py
57
58 epydoc:
59 epydoc.py -o api -v lib
60
61 docs:
62 $(MAKE) -C docs
63
64 ui:
65 python3 setup.py build_ui
66
67
68 # === Tests beyond this point ===
69 # When you run ``brz selftest``, Breezy will scan all its plugins to see if they contain a function named test_suite().
70 # For each plugin that does, it calls the function and adds any resulting tests to the master test suite.
71 # To run just the tests for plugin xxx, the command is: ``brz selftest -s bp.xxx`` so we use bp.qbrz in our case.
72
73 check:
74 BRZ_PLUGINS_AT=qbrz@$(shell pwd) brz selftest --starting-with=bp.qbrz --exclude=TestTreeFilterProxyModel --exclude=TestTreeWidget
75
76 # Stop on first error, ignore TestTreeFilterProxyModel for now
77
78 checkone:
79 BRZ_PLUGINS_AT=qbrz@$(shell pwd) brz selftest -v --one --starting-with=bp.qbrz --exclude=TestTreeFilterProxyModel
80
81 # Test specific item - e.g. for internationalisation, use:
82 #
83 # BRZ_PLUGINS_AT=qbrz@$(shell pwd) brz selftest --one --strict -s bp.qbrz TestI18n
84 checkspecific:
85 BRZ_PLUGINS_AT=qbrz@$(shell pwd) brz selftest -v --one --strict --starting-with=bp.qbrz test_show_widget
86
87
88 # Rather than running the test_ suite, this lets you run the actual plugin - note
89 # that the tests can often pass but the code fails in actual use.
90 qtest:
91 # You can test on qbrz itself like this (qlog in the below example):
92 #
93 # BRZ_PLUGINS_AT=qbrz@$(shell pwd) brz qlog
94 #
95 # If you have a test directory you wish to use, you can pass it to the relevant command.
96 # In this example, we have a test dir of ``~/pythonstuff/bzr_test_dir/dycco`` and we
97 # are developing in ~/pythonstuff/qbrz - thus we call brz with qadd and the dycco directory
98 # Note we have to use ${HOME} for BZR_PLUGINS_AT...
99 #
100 BRZ_PLUGINS_AT=qbrz@${HOME}/pythonstuff/qbrz brz qadd ~/pythonstuff/bzr_test_dir/dycco/
101 #BRZ_PLUGINS_AT=qbrz@${HOME}/pythonstuff/qbrz brz qannotate ~/pythonstuff/qbrz/lib/treewidget.py
102 #BRZ_PLUGINS_AT=qbrz@${HOME}/pythonstuff/qbrz brz qplugins
103
104 test:
105 brz selftest -s bp.qbrz
106
107 # Fully working: (note, qcheckout-ala-explorer is qgetn).
108 # qlog
109 # qadd <- fails to display new files
110 # qannotate, qblame
111 # qcommit
112 # qbrowse
113 # qcat, qviewer
114 # qversion
115 # qplugins
116 # qinit
117 # qbranch
118 # qbind
119 # qunbind
120 # qignore
121 # qinfo
122 # qupdate
123 # quncommit
124 # qpull
125 # qshelve
126 # qunshelve
127 # qtag
128 # qgetn
129 # qrevert
130 # qpush
131 # qsend
132 # qmerge
133 # qconflicts
134 # qresolve
135 # qswitch
136 # qcmd
137 # qsubprocess
138 # qdiff
139 # qconfig
140
141
142 # === qmain ===
143
144 # qmain fails in bzr
145
146
147 # === qverify-signatures ===
148
149 # qverify-signatures fails in bzr
150
151
152 # === qhelp ===
153
154 # qhelp doesn't work for me even in bzr
155
156
157 # === Items in Plug-ins ===
158
159 # NOT working
160 # qinit-workspace, qnew also unknown - they appear to be from the 'explorer' plugin
161
162
163 # === Literate documentation, etc ===
164
165 # This uses pycco to generate the literal documentation.
166 # To rebuild all of it, with an index.html file, use:
167 #
168 # make literate_index
169 #
170 # To just update (although new files won't be added to index.html), use:
171 #
172 # make literate_docs
173 #
174 # otherwise, you can just make the base, lib, or whatever using (for example):
175 #
176 # make widget_docs
177 #
178 # Output goes into docs/literate/... mirroring the source-code locations (e.g.
179 # lib/widgets/... go into docs/literate/lib/widgets
180 #
181 # pycco isn't brilliant, but it tries its best
182
183 # We build or rebuild the documentation with pycco - shorthand for the command here in PYCCO_ALL variable
184 # This one builds the index.html file
185 PYCCO_ALL := pycco --generate_index --paths -s --directory
186
187 # This one does NOT build the index file - otherwise, if you pass a single file
188 # it will be the ONLY one in the index. Do'h!
189 PYCCO_ONE := pycco --paths -s --directory
190
191 # We want to look at all the .py files in the Code directory (where we start)
192 # in case any have changed. The makefile is in /Code so we just use './'
193 # the shell for 'this directory that we are in' - so the following means
194 # 'all the files ending in "py" in this directory'
195 PYMAINSOURCES=$(wildcard ./*.py)
196 # The lib sources
197 PYLIBSOURCES=$(wildcard ./lib/*.py)
198 # extras and tests
199 PYEXTRASOURCES=$(wildcard ./lib/extra/*.py)
200 PYEXTRASSOURCES=$(wildcard ./extras/*.py)
201 PYTESTSSOURCES=$(wildcard ./lib/tests/*.py)
202 PYWIDGETSOURCES=$(wildcard ./lib/widgets/*.py)
203
204 # So now add them all together
205 PYSOURCES=$(PYMAINSOURCES) $(PYLIBSOURCES) $(PYEXTRASOURCES) $(PYEXTRASSOURCES) $(PYTESTSSOURCES) $(PYWIDGETSOURCES)
206
207 # This is how we extract an html file-name for each changed python file-name
208 # It basically reads: for each .py file in the source directory (PYSOURCES),
209 # there should be a matching .html file in Code_Documentation.
210 # The % means the stem, for example world.py has a stem of 'world' so we
211 # make world.html from world.py
212 DOCUMENTS_NEEDED_BASE=$(PYSOURCES:%.py=docs/literate/%.html)
213
214 # For subdirectories, we'll get the subdirectory as a prefix
215 # for example, svrsub/svrconfig
216 DOCUMENTS_NEEDED_LIB=$(PYLIBSOURCES:%.py=docs/literate/%.html)
217 DOCUMENTS_NEEDED_EXTRA=$(PYEXTRASOURCES:%.py=docs/literate/%.html)
218 DOCUMENTS_NEEDED_EXTRAS=$(PYEXTRASSOURCES:%.py=docs/literate/%.html)
219 DOCUMENTS_NEEDED_TEST=$(PYTESTSSOURCES:%.py=docs/literate/%.html)
220 DOCUMENTS_NEEDED_WIDGETS=$(PYWIDGETSOURCES:%.py=docs/literate/%.html)
221
222 .PHONY: literate_docs
223 # No such file as all so mark it as a phony
224 .PHONY: base_docs
225 .PHONY: lib_docs
226 .PHONY: extra_docs
227 .PHONY: extras_docs
228 .PHONY: test_docs
229 .PHONY: widget_docs
230
231 base_docs: $(DOCUMENTS_NEEDED_BASE)
232 lib_docs: $(DOCUMENTS_NEEDED_LIB)
233 extra_docs: $(DOCUMENTS_NEEDED_EXTRA)
234 extras_docs: $(DOCUMENTS_NEEDED_EXTRAS)
235 test_docs: $(DOCUMENTS_NEEDED_TEST)
236 widget_docs: $(DOCUMENTS_NEEDED_WIDGETS)
237
238 literate_docs: base_docs lib_docs extra_docs extras_docs test_docs widget_docs
239
240 # The html file in docs/literate (and its cousins) depends upon the py file of the same name
241 # If the html file is missing or older than the python one, run the pycco command
242 # for the file (in $<)
243
244
245
246 docs/literate/%.html: %.py
247 $(PYCCO_ONE) ./docs/literate $<
248
249
250 docs/literate/extras/%.html: %.py
251 $(PYCCO_ONE) ./docs/literate $<
252
253 docs/literate/lib/%.html: %.py
254 $(PYCCO_ONE) ./docs/literate $<
255
256
257 docs/literate/lib/data/%.html: %.py
258 $(PYCCO_ONE) ./docs/literate $<
259
260 docs/literate/lib/extra/%.html: %.py
261 $(PYCCO_ONE) ./docs/literate $<
262
263 docs/literate/lib/test/%.html: %.py
264 $(PYCCO_ONE) ./docs/literate $<
265
266 docs/literate/lib/widgets/%.html: %.py
267 $(PYCCO_ONE) ./docs/literate $<
268
269 # Call 'make index' to make the full documentation
270 .PHONY: literate_index
271 literate_index:
272 make literate_clean
273 $(PYCCO_ALL) ./docs/literate $(PYSOURCES)
274
275 .PHONY: literate_clean
276 literate_clean:
277 rm -rf docs/literate/