~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to Makefile

  • Committer: Ian Clatworthy
  • Date: 2007-08-14 01:41:33 UTC
  • mto: (2733.1.1 ianc-integration)
  • mto: This revision was merged to the branch mainline in revision 2734.
  • Revision ID: ian.clatworthy@internode.on.net-20070814014133-ekp2s734aj1lfwdp
reorganise Makefile into logical sections

Show diffs side-by-side

added added

removed removed

Lines of Context:
17
17
# A relatively simple Makefile to assist in building parts of bzr. Mostly for
18
18
# building documentation, etc.
19
19
 
 
20
 
 
21
### Core Stuff ###
 
22
 
20
23
.PHONY: all clean extensions pyflakes api-docs
21
24
 
22
25
all: extensions
48
51
        -find . -name "*.pyc" -o -name "*.pyo" | xargs rm -f
49
52
        rm -rf test????.tmp
50
53
 
 
54
# Build API documentation
51
55
docfiles = bzr bzrlib
52
56
api-docs:
53
57
        mkdir -p api/html
54
58
        PYTHONPATH=$(PWD) python tools/bzr_epydoc --html -o api/html --docformat 'restructuredtext en' $(docfiles)
55
 
 
56
59
check-api-docs:
57
60
        PYTHONPATH=$(PWD) python tools/bzr_epydoc --check --docformat 'restructuredtext en' $(docfiles)
58
61
 
59
 
 
60
62
# build emacs cross-reference
61
63
tag_files=./bzr ./bzrlib/*py ./bzrlib/selftest/*.py
62
64
TAGS: $(tag_files)
63
65
        ctags-exuberant -e $(tag_files)
64
66
 
65
67
 
66
 
# Produce HTML docs to upload on Canonical server
67
 
HTMLDIR := html_docs
68
 
PRETTYDIR := pretty_docs
69
 
 
70
 
html-docs: docs
71
 
        python tools/win32/ostools.py copytodir $(htm_files) doc/default.css $(HTMLDIR)
72
 
 
 
68
### Documentation ###
73
69
 
74
70
# translate txt docs to html
75
71
derived_txt_files := \
84
80
dev_txt_files := $(wildcard $(addsuffix /*.txt, doc/developers))
85
81
dev_htm_files := $(patsubst %.txt, %.html, $(dev_txt_files)) 
86
82
 
87
 
pretty-html-docs: pretty_files
88
 
 
89
 
pretty_docs:
90
 
        python -c "import os; os.mkdir('$(PRETTYDIR)')"
91
 
 
92
 
pretty_files: $(patsubst doc/%.txt, $(PRETTYDIR)/%.html, $(txt_files))
93
 
 
94
83
doc/developers/%.html: doc/developers/%.txt
95
84
        python tools/rst2html.py --link-stylesheet --stylesheet=../default.css --footnote-references=superscript $< $@
96
85
 
100
89
%.html: %.txt
101
90
        python tools/rst2html.py --link-stylesheet --stylesheet=../../default.css --footnote-references=superscript $< $@
102
91
 
103
 
$(PRETTYDIR)/%.html: pretty_docs doc/%.txt
104
 
        python tools/rst2prettyhtml.py doc/bazaar-vcs.org.kid doc/$*.txt \
105
 
        $(PRETTYDIR)/$*.html
106
 
 
107
92
MAN_DEPENDENCIES = bzrlib/builtins.py \
108
93
                 bzrlib/bundle/commands.py \
109
94
                 bzrlib/conflicts.py \
129
114
ALL_DOCS = $(htm_files) $(MAN_PAGES) $(dev_htm_files) doc/developers/performance.png
130
115
docs: $(ALL_DOCS)
131
116
 
132
 
copy-docs: docs
133
 
        python tools/win32/ostools.py copytodir $(htm_files) \
134
 
                doc/default.css NEWS README \
135
 
                win32_bzr.exe/doc
136
 
        python tools/win32/ostools.py copytodir $(dev_htm_files) \
137
 
                win32_bzr.exe/doc/developers
 
117
# build a png of our performance task list
 
118
doc/developers/performance.png: doc/developers/performance.dot
 
119
        @echo Generating $@
 
120
        @dot -Tpng $< -o$@ || echo "Dot not installed; skipping generation of $@"
 
121
 
 
122
 
 
123
### Pretty Documentation ###
 
124
 
 
125
# Produce HTML docs to upload on Canonical server
 
126
HTMLDIR := html_docs
 
127
PRETTYDIR := pretty_docs
 
128
 
 
129
html-docs: docs
 
130
        python tools/win32/ostools.py copytodir $(htm_files) doc/default.css $(HTMLDIR)
 
131
 
 
132
$(PRETTYDIR)/%.html: pretty_docs doc/%.txt
 
133
        python tools/rst2prettyhtml.py doc/bazaar-vcs.org.kid doc/$*.txt \
 
134
        $(PRETTYDIR)/$*.html
 
135
 
 
136
pretty-html-docs: pretty_files
 
137
 
 
138
pretty_docs:
 
139
        python -c "import os; os.mkdir('$(PRETTYDIR)')"
 
140
 
 
141
pretty_files: $(patsubst doc/%.txt, $(PRETTYDIR)/%.html, $(txt_files))
138
142
 
139
143
# clean produced docs
140
144
clean-docs:
142
146
        $(HTMLDIR) $(PRETTYDIR) $(derived_txt_files)
143
147
 
144
148
 
145
 
# build a png of our performance task list
146
 
doc/developers/performance.png: doc/developers/performance.dot
147
 
        @echo Generating $@
148
 
        @dot -Tpng $< -o$@ || echo "Dot not installed; skipping generation of $@"
149
 
 
 
149
### Windows Support ###
150
150
 
151
151
# make bzr.exe for win32 with py2exe
152
152
exe:
168
168
        python24 setup.py bdist_wininst --install-script="bzr-win32-bdist-postinstall.py" -d .
169
169
        python25 setup.py bdist_wininst --install-script="bzr-win32-bdist-postinstall.py" -d .
170
170
 
 
171
copy-docs: docs
 
172
        python tools/win32/ostools.py copytodir $(htm_files) \
 
173
                doc/default.css NEWS README \
 
174
                win32_bzr.exe/doc
 
175
        python tools/win32/ostools.py copytodir $(dev_htm_files) \
 
176
                win32_bzr.exe/doc/developers
171
177
 
172
178
# clean on win32 all installer-related files and directories
173
179
clean-win32: clean-docs