/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to Makefile

  • Committer: Breezy landing bot
  • Author(s): Jelmer Vernooij
  • Date: 2017-06-02 11:26:27 UTC
  • mfrom: (6621.27.5 1089352-sni-support)
  • Revision ID: breezy.the.bot@gmail.com-20170602112627-jbvjcm9czx7gt3gb
Add SNI support.

Merged from https://code.launchpad.net/~jelmer/brz/sni-support/+merge/324979

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2005-2010 Canonical Ltd
 
1
# Copyright (C) 2005-2012, 2016, 2017 Canonical Ltd
2
2
#
3
3
# This program is free software; you can redistribute it and/or modify
4
4
# it under the terms of the GNU General Public License as published by
14
14
# along with this program; if not, write to the Free Software
15
15
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
16
16
 
17
 
# A relatively simple Makefile to assist in building parts of bzr. Mostly for
 
17
# A relatively simple Makefile to assist in building parts of brz. Mostly for
18
18
# building documentation, etc.
19
19
 
20
20
 
24
24
PYTHON24=python24
25
25
PYTHON25=python25
26
26
PYTHON26=python26
27
 
BZR_TARGET=release
 
27
BRZ_TARGET=release
28
28
PLUGIN_TARGET=plugin-release
29
29
PYTHON_BUILDFLAGS=
30
30
 
31
 
.PHONY: all clean extensions pyflakes api-docs check-nodocs check
 
31
# Shorter replacement for $(sort $(wildcard <arg>)) as $(call sw,<arg>)
 
32
sw = $(sort $(wildcard $(1)))
 
33
 
 
34
 
 
35
.PHONY: all clean realclean extensions pyflakes api-docs check-nodocs check
32
36
 
33
37
all: extensions
34
38
 
39
43
check: docs check-nodocs
40
44
 
41
45
check-nodocs: extensions
 
46
        set -e
42
47
        # Generate a stream for PQM to watch.
43
 
        $(PYTHON) -Werror -O ./bzr selftest --subunit $(tests) | tee selftest.log
 
48
        -$(RM) -f selftest.log
 
49
        echo `date` ": selftest starts" 1>&2
 
50
        $(PYTHON) -Werror -Wignore::ImportWarning -O ./brz selftest -Oselftest.timeout=120 \
 
51
          --subunit $(tests) | tee selftest.log
 
52
        echo `date` ": selftest ends" 1>&2
 
53
        # An empty log file should catch errors in the $(PYTHON)
 
54
        # command above (the '|' swallow any errors since 'make'
 
55
        # sees the 'tee' exit code for the whole line
 
56
        if [ ! -s selftest.log ] ; then exit 1 ; fi
44
57
        # Check that there were no errors reported.
45
58
        subunit-stats < selftest.log
46
59
 
49
62
# Note that at present this gives many false warnings, because it doesn't
50
63
# know about identifiers loaded through lazy_import.
51
64
pyflakes:
52
 
        pyflakes bzrlib
 
65
        pyflakes breezy
53
66
 
54
67
pyflakes-nounused:
55
68
        # There are many of these warnings at the moment and they're not a
56
69
        # high priority to fix
57
 
        pyflakes bzrlib | grep -v ' imported but unused'
 
70
        pyflakes breezy | grep -v ' imported but unused'
58
71
 
59
72
clean:
60
73
        $(PYTHON) setup.py clean
61
74
        -find . -name "*.pyc" -o -name "*.pyo" -o -name "*.so" | xargs rm -f
62
75
 
 
76
realclean: clean
 
77
        # Remove files which are autogenerated but included by the tarball.
 
78
        rm -f breezy/*_pyx.c
 
79
        rm -f breezy/_simple_set_pyx.h breezy/_simple_set_pyx_api.h
 
80
 
63
81
# Build API documentation
64
 
docfiles = bzr bzrlib
 
82
docfiles = brz breezy
65
83
api-docs:
66
84
        mkdir -p api/html
67
 
        PYTHONPATH=$(PWD) $(PYTHON) tools/bzr_epydoc --html -o api/html --docformat 'restructuredtext en' $(docfiles)
68
 
check-api-docs:
69
 
        PYTHONPATH=$(PWD) $(PYTHON) tools/bzr_epydoc --check --docformat 'restructuredtext en' $(docfiles)
 
85
        pydoctor --make-html --docformat='restructuredtext' --html-output=api/html $(docfiles)
70
86
 
71
87
# build tags for emacs and vim
72
88
TAGS:
73
 
        ctags -R -e bzrlib
 
89
        ctags -R -e breezy
74
90
 
75
91
tags:
76
 
        ctags -R bzrlib
 
92
        ctags -R breezy
77
93
 
78
94
# these are treated as phony so they'll always be rebuilt - it's pretty quick
79
95
.PHONY: TAGS tags
93
109
 
94
110
### Man-page Documentation ###
95
111
 
96
 
MAN_DEPENDENCIES = bzrlib/builtins.py \
97
 
        $(wildcard bzrlib/*.py) \
98
 
        $(wildcard bzrlib/*/*.py) \
 
112
MAN_DEPENDENCIES = breezy/builtins.py \
 
113
        $(call sw,breezy/*.py) \
 
114
        $(call sw,breezy/*/*.py) \
99
115
        tools/generate_docs.py \
100
 
        $(wildcard $(addsuffix /*.txt, bzrlib/help_topics/en)) 
 
116
        $(call sw,$(addsuffix /*.txt, breezy/help_topics/en)) 
101
117
 
102
 
MAN_PAGES = man1/bzr.1
103
 
man1/bzr.1: $(MAN_DEPENDENCIES)
 
118
MAN_PAGES = man1/brz.1
 
119
man1/brz.1: $(MAN_DEPENDENCIES)
104
120
        $(PYTHON) tools/generate_docs.py -o $@ man
105
121
 
106
122
 
133
149
        doc/developers/Makefile \
134
150
        doc/developers/make.bat
135
151
 
 
152
NEWS_FILES = $(call sw,doc/en/release-notes/brz-*.txt)
 
153
 
136
154
doc/en/user-reference/index.txt: $(MAN_DEPENDENCIES)
137
 
        $(PYTHON) tools/generate_docs.py -o $@ rstx
 
155
        LANGUAGE=C $(PYTHON) tools/generate_docs.py -o $@ rstx
138
156
 
139
 
doc/en/release-notes/index.txt: NEWS tools/generate_release_notes.py
140
 
        $(PYTHON) tools/generate_release_notes.py NEWS $@
 
157
doc/en/release-notes/index.txt: $(NEWS_FILES) tools/generate_release_notes.py
 
158
        $(PYTHON) tools/generate_release_notes.py $@ $(NEWS_FILES)
141
159
 
142
160
doc/%/Makefile: doc/en/Makefile
143
161
        $(PYTHON) -c "import shutil; shutil.copyfile('$<', '$@')"
178
196
        cd doc/developers && make htmlhelp
179
197
 
180
198
 
 
199
# Build the texinfo files using Sphinx.
 
200
texinfo-sphinx: $(SPHINX_DEPENDENCIES)
 
201
        cd doc/en && make texinfo
 
202
        cd doc/es && make texinfo
 
203
        cd doc/ru && make texinfo
 
204
        cd doc/ja && make texinfo
 
205
        cd doc/developers && make texinfo
 
206
 
181
207
### Documentation Website ###
182
208
 
183
209
# Where to build the website
205
231
        doc/en/release-notes/NEWS.txt
206
232
txt_all = \
207
233
        doc/en/tutorials/tutorial.txt \
208
 
        doc/en/tutorials/using_bazaar_with_launchpad.txt \
 
234
        doc/en/tutorials/using_breezy_with_launchpad.txt \
209
235
        doc/en/tutorials/centralized_workflow.txt \
210
 
        $(wildcard doc/es/tutorials/*.txt) \
211
 
                $(wildcard doc/ru/tutorials/*.txt) \
 
236
        $(call sw,doc/es/tutorials/*.txt) \
 
237
        $(call sw,doc/ru/tutorials/*.txt) \
212
238
        doc/ja/tutorials/tutorial.txt \
213
239
        doc/ja/tutorials/using_bazaar_with_launchpad.txt \
214
240
        doc/ja/tutorials/centralized_workflow.txt \
215
 
        $(wildcard doc/*/mini-tutorial/index.txt) \
216
 
        $(wildcard doc/*/user-guide/index-plain.txt) \
 
241
        $(call sw,doc/*/mini-tutorial/index.txt) \
 
242
        $(call sw,doc/*/user-guide/index-plain.txt) \
217
243
        doc/en/admin-guide/index-plain.txt \
218
 
        $(wildcard doc/es/guia-usario/*.txt) \
 
244
        $(call sw,doc/es/guia-usario/*.txt) \
219
245
        $(derived_txt_files) \
220
246
        doc/en/upgrade-guide/index.txt \
221
247
        doc/index.txt \
222
 
        $(wildcard doc/index.*.txt)
 
248
        $(call sw,doc/index.*.txt)
223
249
txt_nohtml = \
224
250
        doc/en/user-guide/index.txt \
225
251
        doc/es/user-guide/index.txt \
231
257
 
232
258
non_txt_files = \
233
259
       doc/default.css \
234
 
       $(wildcard doc/*/bzr-en-quick-reference.svg) \
235
 
       $(wildcard doc/*/bzr-en-quick-reference.png) \
236
 
       $(wildcard doc/*/bzr-en-quick-reference.pdf) \
237
 
       $(wildcard doc/*/bzr-es-quick-reference.svg) \
238
 
       $(wildcard doc/*/bzr-es-quick-reference.png) \
239
 
       $(wildcard doc/*/bzr-es-quick-reference.pdf) \
240
 
       $(wildcard doc/*/bzr-ru-quick-reference.svg) \
241
 
       $(wildcard doc/*/bzr-ru-quick-reference.png) \
242
 
       $(wildcard doc/*/bzr-ru-quick-reference.pdf) \
243
 
       $(wildcard doc/*/user-guide/images/*.png)
 
260
       $(call sw,doc/*/brz-en-quick-reference.svg) \
 
261
       $(call sw,doc/*/brz-en-quick-reference.png) \
 
262
       $(call sw,doc/*/brz-en-quick-reference.pdf) \
 
263
       $(call sw,doc/*/bzr-es-quick-reference.svg) \
 
264
       $(call sw,doc/*/bzr-es-quick-reference.png) \
 
265
       $(call sw,doc/*/bzr-es-quick-reference.pdf) \
 
266
       $(call sw,doc/*/bzr-ru-quick-reference.svg) \
 
267
       $(call sw,doc/*/bzr-ru-quick-reference.png) \
 
268
       $(call sw,doc/*/bzr-ru-quick-reference.pdf) \
 
269
       $(call sw,doc/*/user-guide/images/*.png)
244
270
 
245
271
# doc/developers/*.txt files that should *not* be individually
246
272
# converted to HTML
270
296
        doc/developers/status.txt \
271
297
        doc/developers/uncommit.txt
272
298
 
273
 
dev_txt_all = $(wildcard $(addsuffix /*.txt, doc/developers))
 
299
dev_txt_all = $(call sw,$(addsuffix /*.txt, doc/developers))
274
300
dev_txt_files = $(filter-out $(dev_txt_nohtml), $(dev_txt_all))
275
301
dev_htm_files = $(patsubst %.txt, %.html, $(dev_txt_files)) 
276
302
 
277
 
doc/en/user-guide/index-plain.html: $(wildcard $(addsuffix /*.txt, doc/en/user-guide)) 
 
303
doc/en/user-guide/index-plain.html: $(call sw,$(addsuffix /*.txt, doc/en/user-guide))
278
304
        $(rst2html) --stylesheet=../../default.css $(dir $@)index-plain.txt $@
279
305
 
280
 
#doc/es/user-guide/index.html: $(wildcard $(addsuffix /*.txt, doc/es/user-guide)) 
281
 
#       $(rst2html) --stylesheet=../../default.css $(dir $@)index.txt $@
282
 
#
283
 
#doc/ru/user-guide/index.html: $(wildcard $(addsuffix /*.txt, doc/ru/user-guide)) 
284
 
#       $(rst2html) --stylesheet=../../default.css $(dir $@)index.txt $@
285
 
#
286
 
doc/en/admin-guide/index-plain.html: $(wildcard $(addsuffix /*.txt, doc/en/admin-guide)) 
 
306
#doc/es/user-guide/index.html: $(call sw,$(addsuffix /*.txt, doc/es/user-guide))
 
307
#       $(rst2html) --stylesheet=../../default.css $(dir $@)index.txt $@
 
308
#
 
309
#doc/ru/user-guide/index.html: $(call sw,$(addsuffix /*.txt, doc/ru/user-guide))
 
310
#       $(rst2html) --stylesheet=../../default.css $(dir $@)index.txt $@
 
311
#
 
312
doc/en/admin-guide/index-plain.html: $(call sw,$(addsuffix /*.txt, doc/en/admin-guide))
287
313
        $(rst2html) --stylesheet=../../default.css $(dir $@)index-plain.txt $@
288
314
 
289
315
doc/developers/%.html: doc/developers/%.txt
296
322
        $(rst2html) --stylesheet=default.css $< $@
297
323
 
298
324
%.html: %.txt
299
 
        $(rst2html) --stylesheet=../../default.css $< $@
300
 
 
301
 
doc/en/release-notes/NEWS.txt: NEWS
302
 
        $(PYTHON) -c "import shutil; shutil.copyfile('$<', '$@')"
303
 
 
304
 
upgrade_guide_dependencies =  $(wildcard $(addsuffix /*.txt, doc/en/upgrade-guide)) 
 
325
        $(rst2html) --stylesheet=../../default.css $< "$@"
 
326
 
 
327
doc/en/release-notes/NEWS.txt: $(NEWS_FILES) tools/generate_release_notes.py
 
328
        $(PYTHON) tools/generate_release_notes.py "$@" $(NEWS_FILES)
 
329
 
 
330
upgrade_guide_dependencies =  $(call sw,$(addsuffix /*.txt, doc/en/upgrade-guide))
305
331
 
306
332
doc/en/upgrade-guide/index.html: $(upgrade_guide_dependencies)
307
333
        $(rst2html) --stylesheet=../../default.css $(dir $@)index.txt $@
350
376
        $(PYTHON) tools/win32/ostools.py makedir build-win32
351
377
        @# cd to tools/win32 so that the relative paths are copied correctly
352
378
        cd tools/win32 && $(PYTHON) ostools.py copytree $(BUILDOUT_FILES) ../../build-win32
353
 
        @# There seems to be a bug in gf.release.bzr, It doesn't correctly update
 
379
        @# There seems to be a bug in gf.release.brz, It doesn't correctly update
354
380
        @# existing release directories, so delete them manually before building
355
381
        @# It means things may be rebuilt that don't need to be, but at least
356
382
        @# it will be correct when they do.
357
383
        cd build-win32 && $(PYTHON) ostools.py remove release */release
358
384
        cd build-win32 && $(PYTHON) bootstrap.py
359
385
        cd build-win32 && bin/buildout
360
 
        cd build-win32 && bin/build-installer.bat $(BZR_TARGET) $(PLUGIN_TARGET)
 
386
        cd build-win32 && bin/build-installer.bat $(BRZ_TARGET) $(PLUGIN_TARGET)
361
387
 
362
388
 
363
389
clean-installer-all:
364
390
        $(PYTHON) tools/win32/ostools.py remove build-win32
365
391
 
366
 
# make bzr.exe for win32 with py2exe
 
392
# make brz.exe for win32 with py2exe
367
393
exe:
368
 
        @echo *** Make bzr.exe
369
 
        $(PYTHON) tools/win32/ostools.py remove bzrlib/*.pyd
 
394
        @echo *** Make brz.exe
 
395
        $(PYTHON) tools/win32/ostools.py remove breezy/*.pyd
370
396
        $(PYTHON) setup.py build_ext -i -f $(PYTHON_BUILDFLAGS)
371
397
        $(PYTHON) setup.py py2exe > py2exe.log
372
 
        $(PYTHON) tools/win32/ostools.py copytodir tools/win32/start_bzr.bat win32_bzr.exe
373
 
        $(PYTHON) tools/win32/ostools.py copytodir tools/win32/bazaar.url win32_bzr.exe
 
398
        $(PYTHON) tools/win32/ostools.py copytodir tools/win32/start_brz.bat win32_brz.exe
 
399
        $(PYTHON) tools/win32/ostools.py copytodir tools/win32/bazaar.url win32_brz.exe
374
400
 
375
 
# win32 installer for bzr.exe
 
401
# win32 installer for brz.exe
376
402
installer: exe copy-docs
377
403
        @echo *** Make Windows installer
378
 
        $(PYTHON) tools/win32/run_script.py cog.py -d -o tools/win32/bzr.iss tools/win32/bzr.iss.cog
379
 
        iscc /Q tools/win32/bzr.iss
 
404
        $(PYTHON) tools/win32/run_script.py cog.py -d -o tools/win32/brz.iss tools/win32/brz.iss.cog
 
405
        iscc /Q tools/win32/brz.iss
380
406
 
381
407
# win32 Python's distutils-based installer
382
408
# require to have Python interpreter installed on win32
383
409
py-inst-24: docs
384
 
        $(PYTHON24) setup.py bdist_wininst --install-script="bzr-win32-bdist-postinstall.py" -d .
 
410
        $(PYTHON24) setup.py bdist_wininst --install-script="brz-win32-bdist-postinstall.py" -d .
385
411
 
386
412
py-inst-25: docs
387
 
        $(PYTHON25) setup.py bdist_wininst --install-script="bzr-win32-bdist-postinstall.py" -d .
 
413
        $(PYTHON25) setup.py bdist_wininst --install-script="brz-win32-bdist-postinstall.py" -d .
388
414
 
389
415
py-inst-26: docs
390
 
        $(PYTHON26) setup.py bdist_wininst --install-script="bzr-win32-bdist-postinstall.py" -d .
 
416
        $(PYTHON26) setup.py bdist_wininst --install-script="brz-win32-bdist-postinstall.py" -d .
391
417
 
392
418
python-installer: py-inst-24 py-inst-25 py-inst-26
393
419
 
394
420
 
395
421
copy-docs: docs
396
 
        $(PYTHON) tools/win32/ostools.py copytodir README win32_bzr.exe/doc
397
 
        $(PYTHON) tools/win32/ostools.py copytree $(WEB_DOCS) win32_bzr.exe
 
422
        $(PYTHON) tools/win32/ostools.py copytodir README win32_brz.exe/doc
 
423
        $(PYTHON) tools/win32/ostools.py copytree $(WEB_DOCS) win32_brz.exe
398
424
 
399
425
# clean on win32 all installer-related files and directories
400
426
clean-win32: clean-docs
401
427
        $(PYTHON) tools/win32/ostools.py remove build
402
 
        $(PYTHON) tools/win32/ostools.py remove win32_bzr.exe
 
428
        $(PYTHON) tools/win32/ostools.py remove win32_brz.exe
403
429
        $(PYTHON) tools/win32/ostools.py remove py2exe.log
404
 
        $(PYTHON) tools/win32/ostools.py remove tools/win32/bzr.iss
405
 
        $(PYTHON) tools/win32/ostools.py remove bzr-setup*.exe
406
 
        $(PYTHON) tools/win32/ostools.py remove bzr-*win32.exe
 
430
        $(PYTHON) tools/win32/ostools.py remove tools/win32/brz.iss
 
431
        $(PYTHON) tools/win32/ostools.py remove brz-setup*.exe
 
432
        $(PYTHON) tools/win32/ostools.py remove brz-*win32.exe
407
433
        $(PYTHON) tools/win32/ostools.py remove dist
408
434
 
409
435
 
 
436
# i18n targets
 
437
 
 
438
.PHONY: update-pot po/brz.pot
 
439
update-pot: po/brz.pot
 
440
 
 
441
TRANSLATABLE_PYFILES:=$(shell find breezy -name '*.py' \
 
442
                | grep -v 'breezy/tests/' \
 
443
                | grep -v 'breezy/doc' \
 
444
                )
 
445
 
 
446
po/brz.pot: $(PYFILES) $(DOCFILES)
 
447
        $(PYTHON) ./brz export-pot --include-duplicates > po/brz.pot
 
448
        echo $(TRANSLATABLE_PYFILES) | xargs \
 
449
          xgettext --package-name "brz" \
 
450
          --msgid-bugs-address "<bazaar@canonical.com>" \
 
451
          --copyright-holder "Canonical" \
 
452
          --from-code ISO-8859-1 --join --sort-by-file --add-comments=i18n: \
 
453
          -d bzr -p po -o brz.pot
 
454
 
 
455
 
410
456
### Packaging Targets ###
411
457
 
412
458
.PHONY: dist check-dist-tarball
413
459
 
414
460
# build a distribution source tarball
415
 
#
416
 
# this method of copying the pyrex generated files is a bit ugly; it would be
417
 
# nicer to generate it from distutils.
418
461
dist: 
419
 
        version=`./bzr version --short` && \
420
 
        echo Building distribution of bzr $$version && \
421
 
        expbasedir=`mktemp -t -d tmp_bzr_dist.XXXXXXXXXX` && \
422
 
        expdir=$$expbasedir/bzr-$$version && \
423
 
        tarball=$$PWD/../bzr-$$version.tar.gz && \
 
462
        version=`./brz version --short` && \
 
463
        echo Building distribution of brz $$version && \
 
464
        expbasedir=`mktemp -t -d tmp_brz_dist.XXXXXXXXXX` && \
 
465
        expdir=$$expbasedir/brz-$$version && \
 
466
        tarball=$$PWD/../brz-$$version.tar.gz && \
424
467
        $(MAKE) clean && \
425
468
        $(MAKE) && \
426
 
        bzr export $$expdir && \
427
 
        cp bzrlib/*.c bzrlib/*.h $$expdir/bzrlib/. && \
428
 
        tar cfz $$tarball -C $$expbasedir bzr-$$version && \
429
 
        gpg --detach-sign $$tarball && \
 
469
        $(PYTHON) setup.py sdist -d $$PWD/.. && \
 
470
        gpg --detach-sign --armor $$tarball && \
430
471
        rm -rf $$expbasedir
431
472
 
432
473
# run all tests in a previously built tarball
433
474
check-dist-tarball:
434
 
        tmpdir=`mktemp -t -d tmp_bzr_check_dist.XXXXXXXXXX` && \
435
 
        version=`./bzr version --short` && \
436
 
        tarball=$$PWD/../bzr-$$version.tar.gz && \
 
475
        tmpdir=`mktemp -t -d tmp_brz_check_dist.XXXXXXXXXX` && \
 
476
        version=`./brz version --short` && \
 
477
        tarball=$$PWD/../brz-$$version.tar.gz && \
437
478
        tar Cxz $$tmpdir -f $$tarball && \
438
 
        $(MAKE) -C $$tmpdir/bzr-$$version check && \
 
479
        $(MAKE) -C $$tmpdir/brz-$$version check && \
439
480
        rm -rf $$tmpdir