~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to Makefile

Merge bzr.dev, update to use new hooks.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2005-2010 Canonical Ltd
 
1
# Copyright (C) 2005-2011 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
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
 
42
42
        set -e
43
43
        # Generate a stream for PQM to watch.
44
44
        -$(RM) -f selftest.log
45
 
        $(PYTHON) -Werror -O ./bzr selftest --subunit $(tests) | tee selftest.log
 
45
        echo `date` ": selftest starts" 1>&2
 
46
        $(PYTHON) -Werror -Wignore::ImportWarning -O ./bzr selftest -Oselftest.timeout=120 \
 
47
          --subunit $(tests) | tee selftest.log
 
48
        echo `date` ": selftest ends" 1>&2
46
49
        # An empty log file should catch errors in the $(PYTHON)
47
50
        # command above (the '|' swallow any errors since 'make'
48
51
        # sees the 'tee' exit code for the whole line
66
69
        $(PYTHON) setup.py clean
67
70
        -find . -name "*.pyc" -o -name "*.pyo" -o -name "*.so" | xargs rm -f
68
71
 
 
72
realclean: clean
 
73
        # Remove files which are autogenerated but included by the tarball.
 
74
        rm -f bzrlib/*_pyx.c
 
75
        rm -f bzrlib/_simple_set_pyx.h bzrlib/_simple_set_pyx_api.h
 
76
 
69
77
# Build API documentation
70
78
docfiles = bzr bzrlib
71
79
api-docs:
72
80
        mkdir -p api/html
73
 
        PYTHONPATH=$(PWD) $(PYTHON) tools/bzr_epydoc --html -o api/html --docformat 'restructuredtext en' $(docfiles)
74
 
check-api-docs:
75
 
        PYTHONPATH=$(PWD) $(PYTHON) tools/bzr_epydoc --check --docformat 'restructuredtext en' $(docfiles)
 
81
        pydoctor --make-html --docformat='restructuredtext' --html-output=api/html $(docfiles)
76
82
 
77
83
# build tags for emacs and vim
78
84
TAGS:
139
145
        doc/developers/Makefile \
140
146
        doc/developers/make.bat
141
147
 
 
148
NEWS_FILES = $(wildcard doc/en/release-notes/bzr-*.txt)
 
149
 
142
150
doc/en/user-reference/index.txt: $(MAN_DEPENDENCIES)
143
151
        $(PYTHON) tools/generate_docs.py -o $@ rstx
144
152
 
145
 
doc/en/release-notes/index.txt: NEWS tools/generate_release_notes.py
146
 
        $(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)
147
155
 
148
156
doc/%/Makefile: doc/en/Makefile
149
157
        $(PYTHON) -c "import shutil; shutil.copyfile('$<', '$@')"
302
310
        $(rst2html) --stylesheet=default.css $< $@
303
311
 
304
312
%.html: %.txt
305
 
        $(rst2html) --stylesheet=../../default.css $< $@
 
313
        $(rst2html) --stylesheet=../../default.css $< "$@"
306
314
 
307
 
doc/en/release-notes/NEWS.txt: NEWS
308
 
        $(PYTHON) -c "import shutil; shutil.copyfile('$<', '$@')"
 
315
doc/en/release-notes/NEWS.txt: $(NEWS_FILES) tools/generate_release_notes.py
 
316
        $(PYTHON) tools/generate_release_notes.py "$@" $(NEWS_FILES)
309
317
 
310
318
upgrade_guide_dependencies =  $(wildcard $(addsuffix /*.txt, doc/en/upgrade-guide)) 
311
319
 
413
421
        $(PYTHON) tools/win32/ostools.py remove dist
414
422
 
415
423
 
 
424
# i18n targets
 
425
 
 
426
.PHONY: update-pot po/bzr.pot
 
427
update-pot: po/bzr.pot
 
428
 
 
429
TRANSLATABLE_PYFILES:=$(shell find bzrlib -name '*.py' \
 
430
                | grep -v 'bzrlib/tests/' \
 
431
                | grep -v 'bzrlib/doc' \
 
432
                )
 
433
 
 
434
po/bzr.pot: $(PYFILES) $(DOCFILES)
 
435
        $(PYTHON) ./bzr export-pot --include-duplicates > po/bzr.pot
 
436
        echo $(TRANSLATABLE_PYFILES) | xargs \
 
437
          xgettext --package-name "bzr" \
 
438
          --msgid-bugs-address "<bazaar@canonical.com>" \
 
439
          --copyright-holder "Canonical" \
 
440
          --from-code ISO-8859-1 --join --sort-by-file --add-comments=i18n: \
 
441
          -d bzr -p po -o bzr.pot
 
442
 
 
443
 
416
444
### Packaging Targets ###
417
445
 
418
446
.PHONY: dist check-dist-tarball