Merge lp:~richard-wilbur/bzr/1540333-makefiles into lp:bzr

Proposed by Richard Wilbur on 2016-02-01
Status: Work in progress
Proposed branch: lp:~richard-wilbur/bzr/1540333-makefiles
Merge into: lp:bzr
Diff against target: 149 lines (+24/-45)
2 files modified
Makefile (+20/-41)
doc/ru/_static/ru/Makefile (+4/-4)
To merge this branch: bzr merge lp:~richard-wilbur/bzr/1540333-makefiles
Reviewer Review Type Date Requested Status
Vincent Ladeuil 2016-02-01 Pending
Review via email: mp+284600@code.launchpad.net

Description of the change

Fixes lp:1540333
Initial problem when trying to rebuild documentation to test changes: couldn't clean the documentation build.
Also found and fixed an inconsistency between the naming convention in the main Makefile and doc/ru/_static/ru/Makefile for the Russion documentation.

What packages should be installed in order to be able to do a full rebuild of everything for Linux?

To post a comment you must log in.
6616. By Richard Wilbur on 2016-02-01

Remove circular dependencies on doc/en/Makefile and doc/en/make.bat

Unmerged revisions

6616. By Richard Wilbur on 2016-02-01

Remove circular dependencies on doc/en/Makefile and doc/en/make.bat

6615. By Richard Wilbur on 2016-02-01

clean-sphinx should depend on the Makefiles it intends on using. Russian static documentation Makefile updated to naming convention used in ./Makefile.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'Makefile'
2--- Makefile 2012-03-09 16:48:55 +0000
3+++ Makefile 2016-02-01 13:44:14 +0000
4@@ -1,4 +1,4 @@
5-# Copyright (C) 2005-2011 Canonical Ltd
6+# Copyright (C) 2005-2011, 2016 Canonical Ltd
7 #
8 # This program is free software; you can redistribute it and/or modify
9 # it under the terms of the GNU General Public License as published by
10@@ -47,8 +47,8 @@
11 --subunit $(tests) | tee selftest.log
12 echo `date` ": selftest ends" 1>&2
13 # An empty log file should catch errors in the $(PYTHON)
14- # command above (the '|' swallow any errors since 'make'
15- # sees the 'tee' exit code for the whole line
16+ # command above (the '|' swallows any errors since 'make'
17+ # sees the 'tee' exit code for the whole line)
18 if [ ! -s selftest.log ] ; then exit 1 ; fi
19 # Check that there were no errors reported.
20 subunit-stats < selftest.log
21@@ -125,25 +125,19 @@
22 # for installation instructions.
23 docs-sphinx: html-sphinx
24
25+DOC_SUBDIRS := $(shell find doc/ -maxdepth 1 -mindepth 1 -type d -print |\
26+ LC_ALL=C sort)
27+
28+DOC_NEN_SUBDIRS := $(filter-out doc/en,$(DOC_SUBDIRS))
29+
30 # Clean out generated documentation
31-clean-sphinx:
32- cd doc/en && make clean
33- cd doc/es && make clean
34- cd doc/ja && make clean
35- cd doc/ru && make clean
36- cd doc/developers && make clean
37+clean-sphinx: $(foreach d,$(DOC_NEN_SUBDIRS),$(d)/Makefile)
38+ $(foreach d,$(DOC_SUBDIRS), make --directory=$(d) clean; )
39
40 SPHINX_DEPENDENCIES = \
41 doc/en/release-notes/index.txt \
42 doc/en/user-reference/index.txt \
43- doc/es/Makefile \
44- doc/es/make.bat \
45- doc/ja/Makefile \
46- doc/ja/make.bat \
47- doc/ru/Makefile \
48- doc/ru/make.bat \
49- doc/developers/Makefile \
50- doc/developers/make.bat
51+ $(foreach d,$(DOC_SUBDIRS), $(d)/Makefile $(d)/make.bat)
52
53 NEWS_FILES = $(wildcard doc/en/release-notes/bzr-*.txt)
54
55@@ -153,19 +147,15 @@
56 doc/en/release-notes/index.txt: $(NEWS_FILES) tools/generate_release_notes.py
57 $(PYTHON) tools/generate_release_notes.py $@ $(NEWS_FILES)
58
59-doc/%/Makefile: doc/en/Makefile
60+$(foreach d,$(DOC_NEN_SUBDIRS),$(d)/Makefile): doc/en/Makefile
61 $(PYTHON) -c "import shutil; shutil.copyfile('$<', '$@')"
62
63-doc/%/make.bat: doc/en/make.bat
64+$(foreach d,$(DOC_NEN_SUBDIRS),$(d)/make.bat): doc/en/make.bat
65 $(PYTHON) -c "import shutil; shutil.copyfile('$<', '$@')"
66
67 # Build the html docs using Sphinx.
68 html-sphinx: $(SPHINX_DEPENDENCIES)
69- cd doc/en && make html
70- cd doc/es && make html
71- cd doc/ru && make html
72- cd doc/ja && make html
73- cd doc/developers && make html
74+ $(foreach d,$(DOC_SUBDIRS), make --directory=$(d) html; )
75
76 # Build the PDF docs using Sphinx. This requires numerous LaTeX
77 # packages. See http://sphinx.pocoo.org/builders.html for details.
78@@ -185,20 +175,12 @@
79 # Note: HtmlHelp Workshop needs to be used on the generated hhp files
80 # to generate the final chm files.
81 chm-sphinx: $(SPHINX_DEPENDENCIES)
82- cd doc/en && make htmlhelp
83- cd doc/es && make htmlhelp
84- cd doc/ru && make htmlhelp
85- cd doc/ja && make htmlhelp
86- cd doc/developers && make htmlhelp
87+ $(foreach d,$(DOC_SUBDIRS), make --directory=$(d) htmlhelp; )
88
89
90 # Build the texinfo files using Sphinx.
91 texinfo-sphinx: $(SPHINX_DEPENDENCIES)
92- cd doc/en && make texinfo
93- cd doc/es && make texinfo
94- cd doc/ru && make texinfo
95- cd doc/ja && make texinfo
96- cd doc/developers && make texinfo
97+ $(foreach d,$(DOC_SUBDIRS), make --directory=$(d) texinfo; )
98
99 ### Documentation Website ###
100
101@@ -207,11 +189,8 @@
102
103 # Build and package docs into a website, complete with downloads.
104 doc-website: html-sphinx pdf-sphinx
105- $(PYTHON) tools/package_docs.py doc/en $(DOC_WEBSITE_BUILD)
106- $(PYTHON) tools/package_docs.py doc/es $(DOC_WEBSITE_BUILD)
107- $(PYTHON) tools/package_docs.py doc/ru $(DOC_WEBSITE_BUILD)
108- $(PYTHON) tools/package_docs.py doc/ja $(DOC_WEBSITE_BUILD)
109- $(PYTHON) tools/package_docs.py doc/developers $(DOC_WEBSITE_BUILD)
110+ $(foreach d,$(DOC_SUBDIRS), \
111+ $(PYTHON) tools/package_docs.py $(d) $(DOC_WEBSITE_BUILD); )
112
113
114 ### Plain Documentation ###
115@@ -435,8 +414,8 @@
116 update-pot: po/bzr.pot
117
118 TRANSLATABLE_PYFILES:=$(shell find bzrlib -name '*.py' \
119- | grep -v 'bzrlib/tests/' \
120- | grep -v 'bzrlib/doc' \
121+ | grep -v 'bzrlib/tests/' \
122+ | grep -v 'bzrlib/doc' \
123 )
124
125 po/bzr.pot: $(PYFILES) $(DOCFILES)
126
127=== modified file 'doc/ru/_static/ru/Makefile'
128--- doc/ru/_static/ru/Makefile 2009-09-07 05:26:43 +0000
129+++ doc/ru/_static/ru/Makefile 2016-02-01 13:44:14 +0000
130@@ -1,5 +1,5 @@
131-TARGETS=bzr-quick-reference.png bzr-quick-reference.pdf
132-OBJECTS=bzr-quick-reference.svg Makefile
133+TARGETS=bzr-ru-quick-reference.png bzr-ru-quick-reference.pdf
134+OBJECTS=bzr-ru-quick-reference.svg Makefile
135
136 all: $(TARGETS)
137
138@@ -11,9 +11,9 @@
139 .svg.png:
140 rsvg-convert -d 300 -p 300 -z 3.3346 -f png -o $@ $<
141
142-bzr-quick-reference.png: $(OBJECTS)
143+bzr-ru-quick-reference.png: $(OBJECTS)
144
145-bzr-quick-reference.pdf: $(OBJECTS)
146+bzr-ru-quick-reference.pdf: $(OBJECTS)
147
148 clean:
149 rm -f $(TARGETS)