~launchpad-pqm/launchpad/devel

« back to all changes in this revision

Viewing changes to Makefile

  • Committer: Martin Pool
  • Date: 2010-11-19 07:51:47 UTC
  • mto: This revision was merged to the branch mainline in revision 11957.
  • Revision ID: mbp@canonical.com-20101119075147-xyt7cru1smdlu5n0
Further updates to parallel Make:

* depend on actually existing files, not phony files, to avoid unnecessary rebuilding
* touch files generate by buildout, rather than deleting them
* don't try to delete phony 'buildout_bin' 

Show diffs side-by-side

added added

removed removed

Lines of Context:
34
34
# Do not add bin/buildout to this list.
35
35
# It is impossible to get buildout to tell us all the files it would
36
36
# build, since each egg's setup.py doesn't tell us that information.
 
37
#
 
38
# NB: It's important BUILDOUT_BIN only mentions things genuinely produced by
 
39
# buildout.
37
40
BUILDOUT_BIN = \
38
41
    $(PY) bin/apiindex bin/combine-css bin/fl-build-report \
39
42
    bin/fl-credential-ctl bin/fl-install-demo bin/fl-monitor-ctl \
57
60
newsampledata:
58
61
        $(MAKE) -C database/schema newsampledata
59
62
 
60
 
hosted_branches: buildout_bin
 
63
hosted_branches: $(PY)
61
64
        $(PY) ./utilities/make-dummy-hosted-branches
62
65
 
63
 
$(API_INDEX): $(BZR_VERSION_INFO) buildout_bin
 
66
$(API_INDEX): $(BZR_VERSION_INFO) $(PY)
64
67
        mkdir -p $(APIDOC_DIR).tmp
65
68
        LPCONFIG=$(LPCONFIG) $(PY) ./utilities/create-lp-wadl-and-apidoc.py --force "$(WADL_TEMPLATE)"
66
69
        mv $(APIDOC_DIR).tmp $(APIDOC_DIR)
68
71
apidoc: compile $(API_INDEX)
69
72
 
70
73
# Run by PQM.
71
 
check_merge: buildout_bin
 
74
check_merge: $(BUILDOUT_BIN)
72
75
        [ `PYTHONPATH= bzr status -S database/schema/ | \
73
76
                grep -v "\(^P\|pending\|security.cfg\|Makefile\|unautovacuumable\|_pythonpath.py\)" | wc -l` -eq 0 ]
74
77
        ${PY} lib/canonical/tests/test_no_conflict_marker.py
75
78
 
76
 
check_db_merge: buildout_bin
 
79
check_db_merge: $(PY)
77
80
        ${PY} lib/canonical/tests/test_no_conflict_marker.py
78
81
 
79
82
check_config: build
111
114
        ${PY} -t ./test_on_merge.py $(VERBOSITY) $(TESTOPTS) \
112
115
                --layer=MailmanLayer
113
116
 
114
 
lint: buildout_bin
 
117
lint: ${PY}
115
118
        @bash ./bin/lint.sh
116
119
 
117
 
lint-verbose: buildout_bin
 
120
lint-verbose: ${PY}
118
121
        @bash ./bin/lint.sh -v
119
122
 
120
 
xxxreport: buildout_bin
 
123
xxxreport: $(PY)
121
124
        ${PY} -t ./utilities/xxxreport.py -f csv -o xxx-report.csv ./
122
125
 
123
 
check-configs: buildout_bin
 
126
check-configs: $(PY)
124
127
        ${PY} utilities/check-configs.py
125
128
 
126
129
pagetests: build
149
152
        ${SHHH} bin/jsbuild $(JSFLAGS) -b $(LAZR_BUILT_JS_ROOT) -x testing/ \
150
153
        -c $(LAZR_BUILT_JS_ROOT)/yui
151
154
 
152
 
jsbuild: jsbuild_lazr bin/jsbuild bin/jssize buildout_bin
 
155
jsbuild: jsbuild_lazr bin/jsbuild bin/jssize $(BUILDOUT_BIN)
153
156
        ${SHHH} bin/jsbuild \
154
157
                $(JSFLAGS) \
155
158
                -n launchpad \
177
180
        @exit 1
178
181
endif
179
182
 
180
 
buildonce_eggs: buildout_bin
 
183
buildonce_eggs: $(PY)
181
184
        find eggs -name '*.pyc' -exec rm {} \;
182
185
 
183
186
# The download-cache dependency comes *before* eggs so that developers get the
185
188
# directory is only there for deployment convenience.
186
189
# Note that the buildout version must be maintained here and in versions.cfg
187
190
# to make sure that the build does not go over the network.
 
191
#
 
192
# buildout won't touch files that would have the same contents, but for Make's
 
193
# sake we need them to get fresh timestamps, so we touch them after building.
188
194
bin/buildout: download-cache eggs
189
195
        $(SHHH) PYTHONPATH= $(PYTHON) bootstrap.py\
190
196
                --setup-source=ez_setup.py \
191
197
                --download-base=download-cache/dist --eggs=eggs \
192
198
                --version=1.5.1
 
199
        touch --no-create $@
193
200
 
194
201
# This target is used by LOSAs to prepare a build to be pushed out to
195
202
# destination machines.  We only want eggs: they are the expensive bits,
196
203
# and the other bits might run into problems like bug 575037.  This
197
204
# target runs buildout, and then removes everything created except for
198
205
# the eggs.
199
 
build_eggs: buildout_bin clean_buildout
200
 
 
201
 
$(BUILDOUT_BIN): buildout_bin
 
206
build_eggs: $(BUILDOUT_BIN)
202
207
 
203
208
# This builds bin/py and all the other bin files except bin/buildout.
204
209
# Remove the target before calling buildout to ensure that buildout
205
210
# updates the timestamp.
206
 
buildout_bin: bin/buildout versions.cfg $(BUILDOUT_CFG) setup.py \
 
211
buildout_bin: $(BUILDOUT_BIN)
 
212
 
 
213
# buildout won't touch files that would have the same contents, but for Make's
 
214
# sake we need them to get fresh timestamps, so we touch them after building.
 
215
#
 
216
# If we listed every target on the left-hand side, a parallel make would try
 
217
# multiple copies of this rule to build them all.  Instead, we nominally build
 
218
# just $(PY), and everything else is implicitly updated by that.
 
219
$(PY): bin/buildout versions.cfg $(BUILDOUT_CFG) setup.py \
207
220
                $(BUILDOUT_TEMPLATES)
208
 
        $(RM) $@
209
221
        $(SHHH) PYTHONPATH= ./bin/buildout \
210
222
                configuration:instance_name=${LPCONFIG} -c $(BUILDOUT_CFG)
 
223
        touch $@
 
224
 
 
225
$(subst $(PY),,$(BUILDOUT_BIN)): $(PY)
211
226
 
212
227
# bin/compile_templates is responsible for building all chameleon templates,
213
228
# of which there is currently one, but of which many more are coming.
214
 
compile: buildout_bin $(BZR_VERSION_INFO)
 
229
compile: $(PY) $(BZR_VERSION_INFO)
215
230
        mkdir -p /var/tmp/vostok-archive
216
231
        ${SHHH} $(MAKE) -C sourcecode build PYTHON=${PYTHON} \
217
232
            LPCONFIG=${LPCONFIG}