/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: Jelmer Vernooij
  • Date: 2017-05-30 19:16:23 UTC
  • mto: This revision was merged to the branch mainline in revision 6639.
  • Revision ID: jelmer@jelmer.uk-20170530191623-t9ls96vjy9wslpoo
Remove deprecated functionality.

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
.PHONY: all clean realclean extensions pyflakes api-docs check-nodocs check
32
32
 
33
33
all: extensions
34
34
 
39
39
check: docs check-nodocs
40
40
 
41
41
check-nodocs: extensions
 
42
        set -e
42
43
        # Generate a stream for PQM to watch.
43
 
        $(PYTHON) -Werror -O ./bzr selftest --subunit $(tests) | tee selftest.log
 
44
        -$(RM) -f selftest.log
 
45
        echo `date` ": selftest starts" 1>&2
 
46
        $(PYTHON) -Werror -Wignore::ImportWarning -O ./brz selftest -Oselftest.timeout=120 \
 
47
          --subunit $(tests) | tee selftest.log
 
48
        echo `date` ": selftest ends" 1>&2
 
49
        # An empty log file should catch errors in the $(PYTHON)
 
50
        # command above (the '|' swallow any errors since 'make'
 
51
        # sees the 'tee' exit code for the whole line
 
52
        if [ ! -s selftest.log ] ; then exit 1 ; fi
44
53
        # Check that there were no errors reported.
45
54
        subunit-stats < selftest.log
46
55
 
49
58
# Note that at present this gives many false warnings, because it doesn't
50
59
# know about identifiers loaded through lazy_import.
51
60
pyflakes:
52
 
        pyflakes bzrlib
 
61
        pyflakes breezy
53
62
 
54
63
pyflakes-nounused:
55
64
        # There are many of these warnings at the moment and they're not a
56
65
        # high priority to fix
57
 
        pyflakes bzrlib | grep -v ' imported but unused'
 
66
        pyflakes breezy | grep -v ' imported but unused'
58
67
 
59
68
clean:
60
69
        $(PYTHON) setup.py clean
61
70
        -find . -name "*.pyc" -o -name "*.pyo" -o -name "*.so" | xargs rm -f
62
71
 
 
72
realclean: clean
 
73
        # Remove files which are autogenerated but included by the tarball.
 
74
        rm -f breezy/*_pyx.c
 
75
        rm -f breezy/_simple_set_pyx.h breezy/_simple_set_pyx_api.h
 
76
 
63
77
# Build API documentation
64
 
docfiles = bzr bzrlib
 
78
docfiles = brz breezy
65
79
api-docs:
66
80
        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)
 
81
        pydoctor --make-html --docformat='restructuredtext' --html-output=api/html $(docfiles)
70
82
 
71
83
# build tags for emacs and vim
72
84
TAGS:
73
 
        ctags -R -e bzrlib
 
85
        ctags -R -e breezy
74
86
 
75
87
tags:
76
 
        ctags -R bzrlib
 
88
        ctags -R breezy
77
89
 
78
90
# these are treated as phony so they'll always be rebuilt - it's pretty quick
79
91
.PHONY: TAGS tags
93
105
 
94
106
### Man-page Documentation ###
95
107
 
96
 
MAN_DEPENDENCIES = bzrlib/builtins.py \
97
 
        $(wildcard bzrlib/*.py) \
98
 
        $(wildcard bzrlib/*/*.py) \
 
108
MAN_DEPENDENCIES = breezy/builtins.py \
 
109
        $(wildcard breezy/*.py) \
 
110
        $(wildcard breezy/*/*.py) \
99
111
        tools/generate_docs.py \
100
 
        $(wildcard $(addsuffix /*.txt, bzrlib/help_topics/en)) 
 
112
        $(wildcard $(addsuffix /*.txt, breezy/help_topics/en)) 
101
113
 
102
 
MAN_PAGES = man1/bzr.1
103
 
man1/bzr.1: $(MAN_DEPENDENCIES)
 
114
MAN_PAGES = man1/brz.1
 
115
man1/brz.1: $(MAN_DEPENDENCIES)
104
116
        $(PYTHON) tools/generate_docs.py -o $@ man
105
117
 
106
118
 
133
145
        doc/developers/Makefile \
134
146
        doc/developers/make.bat
135
147
 
 
148
NEWS_FILES = $(wildcard doc/en/release-notes/brz-*.txt)
 
149
 
136
150
doc/en/user-reference/index.txt: $(MAN_DEPENDENCIES)
137
 
        $(PYTHON) tools/generate_docs.py -o $@ rstx
 
151
        LANGUAGE=C $(PYTHON) tools/generate_docs.py -o $@ rstx
138
152
 
139
 
doc/en/release-notes/index.txt: NEWS tools/generate_release_notes.py
140
 
        $(PYTHON) tools/generate_release_notes.py NEWS $@
 
153
doc/en/release-notes/index.txt: $(NEWS_FILES) tools/generate_release_notes.py
 
154
        $(PYTHON) tools/generate_release_notes.py $@ $(NEWS_FILES)
141
155
 
142
156
doc/%/Makefile: doc/en/Makefile
143
157
        $(PYTHON) -c "import shutil; shutil.copyfile('$<', '$@')"
178
192
        cd doc/developers && make htmlhelp
179
193
 
180
194
 
 
195
# Build the texinfo files using Sphinx.
 
196
texinfo-sphinx: $(SPHINX_DEPENDENCIES)
 
197
        cd doc/en && make texinfo
 
198
        cd doc/es && make texinfo
 
199
        cd doc/ru && make texinfo
 
200
        cd doc/ja && make texinfo
 
201
        cd doc/developers && make texinfo
 
202
 
181
203
### Documentation Website ###
182
204
 
183
205
# Where to build the website
231
253
 
232
254
non_txt_files = \
233
255
       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) \
 
256
       $(wildcard doc/*/brz-en-quick-reference.svg) \
 
257
       $(wildcard doc/*/brz-en-quick-reference.png) \
 
258
       $(wildcard doc/*/brz-en-quick-reference.pdf) \
237
259
       $(wildcard doc/*/bzr-es-quick-reference.svg) \
238
260
       $(wildcard doc/*/bzr-es-quick-reference.png) \
239
261
       $(wildcard doc/*/bzr-es-quick-reference.pdf) \
296
318
        $(rst2html) --stylesheet=default.css $< $@
297
319
 
298
320
%.html: %.txt
299
 
        $(rst2html) --stylesheet=../../default.css $< $@
 
321
        $(rst2html) --stylesheet=../../default.css $< "$@"
300
322
 
301
 
doc/en/release-notes/NEWS.txt: NEWS
302
 
        $(PYTHON) -c "import shutil; shutil.copyfile('$<', '$@')"
 
323
doc/en/release-notes/NEWS.txt: $(NEWS_FILES) tools/generate_release_notes.py
 
324
        $(PYTHON) tools/generate_release_notes.py "$@" $(NEWS_FILES)
303
325
 
304
326
upgrade_guide_dependencies =  $(wildcard $(addsuffix /*.txt, doc/en/upgrade-guide)) 
305
327
 
350
372
        $(PYTHON) tools/win32/ostools.py makedir build-win32
351
373
        @# cd to tools/win32 so that the relative paths are copied correctly
352
374
        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
 
375
        @# There seems to be a bug in gf.release.brz, It doesn't correctly update
354
376
        @# existing release directories, so delete them manually before building
355
377
        @# It means things may be rebuilt that don't need to be, but at least
356
378
        @# it will be correct when they do.
357
379
        cd build-win32 && $(PYTHON) ostools.py remove release */release
358
380
        cd build-win32 && $(PYTHON) bootstrap.py
359
381
        cd build-win32 && bin/buildout
360
 
        cd build-win32 && bin/build-installer.bat $(BZR_TARGET) $(PLUGIN_TARGET)
 
382
        cd build-win32 && bin/build-installer.bat $(BRZ_TARGET) $(PLUGIN_TARGET)
361
383
 
362
384
 
363
385
clean-installer-all:
364
386
        $(PYTHON) tools/win32/ostools.py remove build-win32
365
387
 
366
 
# make bzr.exe for win32 with py2exe
 
388
# make brz.exe for win32 with py2exe
367
389
exe:
368
 
        @echo *** Make bzr.exe
369
 
        $(PYTHON) tools/win32/ostools.py remove bzrlib/*.pyd
 
390
        @echo *** Make brz.exe
 
391
        $(PYTHON) tools/win32/ostools.py remove breezy/*.pyd
370
392
        $(PYTHON) setup.py build_ext -i -f $(PYTHON_BUILDFLAGS)
371
393
        $(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
 
394
        $(PYTHON) tools/win32/ostools.py copytodir tools/win32/start_brz.bat win32_brz.exe
 
395
        $(PYTHON) tools/win32/ostools.py copytodir tools/win32/bazaar.url win32_brz.exe
374
396
 
375
 
# win32 installer for bzr.exe
 
397
# win32 installer for brz.exe
376
398
installer: exe copy-docs
377
399
        @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
 
400
        $(PYTHON) tools/win32/run_script.py cog.py -d -o tools/win32/brz.iss tools/win32/brz.iss.cog
 
401
        iscc /Q tools/win32/brz.iss
380
402
 
381
403
# win32 Python's distutils-based installer
382
404
# require to have Python interpreter installed on win32
383
405
py-inst-24: docs
384
 
        $(PYTHON24) setup.py bdist_wininst --install-script="bzr-win32-bdist-postinstall.py" -d .
 
406
        $(PYTHON24) setup.py bdist_wininst --install-script="brz-win32-bdist-postinstall.py" -d .
385
407
 
386
408
py-inst-25: docs
387
 
        $(PYTHON25) setup.py bdist_wininst --install-script="bzr-win32-bdist-postinstall.py" -d .
 
409
        $(PYTHON25) setup.py bdist_wininst --install-script="brz-win32-bdist-postinstall.py" -d .
388
410
 
389
411
py-inst-26: docs
390
 
        $(PYTHON26) setup.py bdist_wininst --install-script="bzr-win32-bdist-postinstall.py" -d .
 
412
        $(PYTHON26) setup.py bdist_wininst --install-script="brz-win32-bdist-postinstall.py" -d .
391
413
 
392
414
python-installer: py-inst-24 py-inst-25 py-inst-26
393
415
 
394
416
 
395
417
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
 
418
        $(PYTHON) tools/win32/ostools.py copytodir README win32_brz.exe/doc
 
419
        $(PYTHON) tools/win32/ostools.py copytree $(WEB_DOCS) win32_brz.exe
398
420
 
399
421
# clean on win32 all installer-related files and directories
400
422
clean-win32: clean-docs
401
423
        $(PYTHON) tools/win32/ostools.py remove build
402
 
        $(PYTHON) tools/win32/ostools.py remove win32_bzr.exe
 
424
        $(PYTHON) tools/win32/ostools.py remove win32_brz.exe
403
425
        $(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
 
426
        $(PYTHON) tools/win32/ostools.py remove tools/win32/brz.iss
 
427
        $(PYTHON) tools/win32/ostools.py remove brz-setup*.exe
 
428
        $(PYTHON) tools/win32/ostools.py remove brz-*win32.exe
407
429
        $(PYTHON) tools/win32/ostools.py remove dist
408
430
 
409
431
 
 
432
# i18n targets
 
433
 
 
434
.PHONY: update-pot po/brz.pot
 
435
update-pot: po/brz.pot
 
436
 
 
437
TRANSLATABLE_PYFILES:=$(shell find breezy -name '*.py' \
 
438
                | grep -v 'breezy/tests/' \
 
439
                | grep -v 'breezy/doc' \
 
440
                )
 
441
 
 
442
po/brz.pot: $(PYFILES) $(DOCFILES)
 
443
        $(PYTHON) ./brz export-pot --include-duplicates > po/brz.pot
 
444
        echo $(TRANSLATABLE_PYFILES) | xargs \
 
445
          xgettext --package-name "brz" \
 
446
          --msgid-bugs-address "<bazaar@canonical.com>" \
 
447
          --copyright-holder "Canonical" \
 
448
          --from-code ISO-8859-1 --join --sort-by-file --add-comments=i18n: \
 
449
          -d bzr -p po -o brz.pot
 
450
 
 
451
 
410
452
### Packaging Targets ###
411
453
 
412
454
.PHONY: dist check-dist-tarball
413
455
 
414
456
# 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
457
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 && \
 
458
        version=`./brz version --short` && \
 
459
        echo Building distribution of brz $$version && \
 
460
        expbasedir=`mktemp -t -d tmp_brz_dist.XXXXXXXXXX` && \
 
461
        expdir=$$expbasedir/brz-$$version && \
 
462
        tarball=$$PWD/../brz-$$version.tar.gz && \
424
463
        $(MAKE) clean && \
425
464
        $(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 && \
 
465
        $(PYTHON) setup.py sdist -d $$PWD/.. && \
 
466
        gpg --detach-sign --armor $$tarball && \
430
467
        rm -rf $$expbasedir
431
468
 
432
469
# run all tests in a previously built tarball
433
470
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 && \
 
471
        tmpdir=`mktemp -t -d tmp_brz_check_dist.XXXXXXXXXX` && \
 
472
        version=`./brz version --short` && \
 
473
        tarball=$$PWD/../brz-$$version.tar.gz && \
437
474
        tar Cxz $$tmpdir -f $$tarball && \
438
 
        $(MAKE) -C $$tmpdir/bzr-$$version check && \
 
475
        $(MAKE) -C $$tmpdir/brz-$$version check && \
439
476
        rm -rf $$tmpdir