~launchpad-pqm/launchpad/devel

1102 by Canonical.com Patch Queue Manager
Lucille had some XXXs which should have been NOTEs
1
# This file modified from Zope3/Makefile
2
# Licensed under the ZPL, (c) Zope Corporation and contributors.
3
12190.1.1 by Jonathan Lange
Always use Python 2.6
4
PYTHON=python2.6
8234.1.2 by Gary Poster
checkpoint: this initial buildout variant has several parts working, including run, start, stop, and harness.
5
WD:=$(shell pwd)
6
PY=$(WD)/bin/py
14273.3.4 by mbp at canonical
lpbuildd is not directly needed by the Makefile
7
PYTHONPATH:=$(WD)/lib:$(WD)/lib/mailman:${PYTHONPATH}
7675.288.1 by Michael Hudson
this seems to help testing against bzr.dev
8
BUILDOUT_CFG=buildout.cfg
4385.1.12 by Stuart Bishop
Remove unmaintainable profiled_ rules, switching to a variable that can be overridden on the command line
9
VERBOSITY=-vv
1716.1.49 by Christian Reis
Removing cruft from the main Makefile
10
4385.1.12 by Stuart Bishop
Remove unmaintainable profiled_ rules, switching to a variable that can be overridden on the command line
11
TESTFLAGS=-p $(VERBOSITY)
1102 by Canonical.com Patch Queue Manager
Lucille had some XXXs which should have been NOTEs
12
TESTOPTS=
1716.1.49 by Christian Reis
Removing cruft from the main Makefile
13
8942.1.1 by Francis J. Lacoste
Silenced bootstrap.py and buildout.py.
14
SHHH=utilities/shhh.py
1102 by Canonical.com Patch Queue Manager
Lucille had some XXXs which should have been NOTEs
15
HERE:=$(shell pwd)
1716.1.49 by Christian Reis
Removing cruft from the main Makefile
16
11483.4.1 by Jelmer Vernooij
Only assign LPCONFIG if it is not yet set.
17
LPCONFIG?=development
1102 by Canonical.com Patch Queue Manager
Lucille had some XXXs which should have been NOTEs
18
7675.507.27 by Edwin Grubbs
Prevent "make sprite_css" from running unnecessarily.
19
ICING=lib/canonical/launchpad/icing
20
LP_BUILT_JS_ROOT=${ICING}/build
9887.2.1 by Gary Poster
Makefile for making Python 2.5 a smoother transition
21
12581.1.4 by Gavin Panella
Also build lazr.js according to JS_BUILD.
22
ifeq ($(LPCONFIG), development)
12581.1.6 by Gavin Panella
Use a raw build by default.
23
JS_BUILD := raw
12581.1.4 by Gavin Panella
Also build lazr.js according to JS_BUILD.
24
else
12581.1.3 by Gavin Panella
Get most javascript building according to JS_BUILD.
25
JS_BUILD := min
12581.1.4 by Gavin Panella
Also build lazr.js according to JS_BUILD.
26
endif
27
13444.4.2 by Gavin Panella
Allow *.*.js in launchpad.js, and clean up Makefile a little bit.
28
define JS_LP_PATHS
29
lib -path 'lib/lp/*/javascript/*' \
13662.7.79 by Henning Eggers
Makefile change was a Bad Idea.
30
! -path '*/tests/*' ! -path '*/testing/*' \
13444.4.2 by Gavin Panella
Allow *.*.js in launchpad.js, and clean up Makefile a little bit.
31
! -path 'lib/lp/services/*'
13333.9.1 by Gavin Panella
Fix lint.
32
endef
33
12581.1.6 by Gavin Panella
Use a raw build by default.
34
JS_YUI := $(shell utilities/yui-deps.py $(JS_BUILD:raw=))
14565.2.3 by Curtis Hovey
Move the remaining javascript to lp.app.
35
JS_LP := $(shell find -L $(JS_LP_PATHS) -name '*.js' ! -name '.*.js')
36
JS_ALL := $(JS_YUI) $(JS_LP)
12581.1.3 by Gavin Panella
Get most javascript building according to JS_BUILD.
37
JS_OUT := $(LP_BUILT_JS_ROOT)/launchpad.js
38
13314.8.2 by j.c.sackett
Fixed typo.
39
MINS_TO_SHUTDOWN=15
5447.1.2 by Tom Haddon
Constant for shutdown and correct path locations
40
6206.1.1 by Tim Penhey
Update development location changes.
41
CODEHOSTING_ROOT=/var/tmp/bazaar.launchpad.dev
42
7430.1.3 by Gavin Panella
Post-review changes, and a few others.
43
BZR_VERSION_INFO = bzr-version-info.py
44
10420.4.1 by Leonard Richardson
Initial implementation.
45
APIDOC_DIR = lib/canonical/launchpad/apidoc
13289.2.1 by Gary Poster
make changes so that the wadl can be served directly from Apache.
46
APIDOC_TMPDIR = $(APIDOC_DIR).tmp/
10420.4.1 by Leonard Richardson
Initial implementation.
47
API_INDEX = $(APIDOC_DIR)/index.html
6770.2.10 by Francis J. Lacoste
Hook documentation generation in Makefile.
48
7675.573.1 by Edwin Grubbs
Run buildout if sprite-util does not exist.
49
# Do not add bin/buildout to this list.
50
# It is impossible to get buildout to tell us all the files it would
51
# build, since each egg's setup.py doesn't tell us that information.
11944.1.1 by Martin Pool
Further updates to parallel Make:
52
#
53
# NB: It's important BUILDOUT_BIN only mentions things genuinely produced by
54
# buildout.
7675.573.1 by Edwin Grubbs
Run buildout if sprite-util does not exist.
55
BUILDOUT_BIN = \
7675.573.2 by Edwin Grubbs
Fixed bin/py rule.
56
    $(PY) bin/apiindex bin/combine-css bin/fl-build-report \
7675.573.1 by Edwin Grubbs
Run buildout if sprite-util does not exist.
57
    bin/fl-credential-ctl bin/fl-install-demo bin/fl-monitor-ctl \
58
    bin/fl-record bin/fl-run-bench bin/fl-run-test bin/googletestservice \
59
    bin/i18ncompile bin/i18nextract bin/i18nmergeall bin/i18nstats \
13447.1.3 by Curtis Hovey
Removed jssize because it only exists for windmill which was removed.
60
    bin/harness bin/iharness bin/ipy bin/jsbuild \
13447.1.1 by Curtis Hovey
Removed old jslint tool
61
    bin/killservice bin/kill-test-services bin/lint.sh bin/retest \
13992.1.1 by Gary Poster
Add yui xhr integration test support.
62
    bin/run bin/run-testapp bin/sprite-util bin/start_librarian bin/stxdocs \
63
    bin/tags bin/test bin/tracereport bin/twistd bin/update-download-cache
7675.573.1 by Edwin Grubbs
Run buildout if sprite-util does not exist.
64
11926.6.2 by Jeroen Vermeulen
Review change, and lint.
65
BUILDOUT_TEMPLATES = buildout-templates/_pythonpath.py.in
66
63.1.71 by Robert Collins
do not make check by default "make" invocation
67
# DO NOT ALTER : this should just build by default
68
default: inplace
1102 by Canonical.com Patch Queue Manager
Lucille had some XXXs which should have been NOTEs
69
11968.1.2 by Tim Penhey
Reordering rules.
70
schema: build
3024.1.1 by Christian Reis
You can't make schema without make building, so make it mandatory. Patch by Matt Zimmerman <mdz@canonical.com>
71
	$(MAKE) -C database/schema
7430.1.1 by Gavin Panella
Clean up the Makefile, including splittig the API doc task into three.
72
	$(RM) -r /var/tmp/fatsam
1716.1.42 by Christian Reis
merged and unconflicted
73
1716.5.35 by kiko
Add for convenience a newsampledata proxy target to the main Makefile.
74
newsampledata:
75
	$(MAKE) -C database/schema newsampledata
76
11944.1.1 by Martin Pool
Further updates to parallel Make:
77
hosted_branches: $(PY)
8234.1.2 by Gary Poster
checkpoint: this initial buildout variant has several parts working, including run, start, stop, and harness.
78
	$(PY) ./utilities/make-dummy-hosted-branches
79
11944.1.1 by Martin Pool
Further updates to parallel Make:
80
$(API_INDEX): $(BZR_VERSION_INFO) $(PY)
14320.1.2 by Steve Kowalik
Fix one missing rm call to be .
81
	$(RM) -r $(APIDOC_DIR) $(APIDOC_DIR).tmp
11744.1.1 by Benji York
revert check-in-wadl merge
82
	mkdir -p $(APIDOC_DIR).tmp
12702.1.4 by Brad Crittenden
Per review: combined makefile rules, removed use of 'cmp' in sorted()
83
	LPCONFIG=$(LPCONFIG) $(PY) ./utilities/create-lp-wadl-and-apidoc.py \
13289.2.1 by Gary Poster
make changes so that the wadl can be served directly from Apache.
84
	    --force "$(APIDOC_TMPDIR)"
85
	mv $(APIDOC_TMPDIR) $(APIDOC_DIR)
7430.1.1 by Gavin Panella
Clean up the Makefile, including splittig the API doc task into three.
86
10466.8.2 by Leonard Richardson
Minor cleanup.
87
apidoc: compile $(API_INDEX)
88
12314.2.3 by Jonathan Lange
Add a top-level make target.
89
# Used to generate HTML developer documentation for Launchpad.
90
doc:
91
	$(MAKE) -C doc/ html
92
10870.1.1 by Maris Fogels
Added a new target for running the test suite in an ec2 image. Removed the WindmillLayer from that target. Fixed up the Makefile API a bit.
93
# Run by PQM.
8665.1.5 by Francis J. Lacoste
Add check_config target.
94
check_config: build
14605.1.1 by Curtis Hovey
Moved canonical.config to lp.services.
95
	bin/test -m lp.services.config.tests -vvt test_config
8665.1.5 by Francis J. Lacoste
Add check_config target.
96
8780.1.1 by Julian Edwards
Make clean a dependency of check in the top-level Makefile
97
# Clean before running the test suite, since the build might fail depending
98
# what source changes happened. (e.g. apidoc depends on interfaces)
99
check: clean build
1102 by Canonical.com Patch Queue Manager
Lucille had some XXXs which should have been NOTEs
100
	# Run all tests. test_on_merge.py takes care of setting up the
8234.1.6 by Gary Poster
fold bin/py into compile
101
	# database.
10870.1.1 by Maris Fogels
Added a new target for running the test suite in an ec2 image. Removed the WindmillLayer from that target. Fixed up the Makefile API a bit.
102
	${PY} -t ./test_on_merge.py $(VERBOSITY) $(TESTOPTS)
13747.1.5 by Steve Kowalik
Use --no-pending instead
103
	bzr status --no-pending
10870.1.1 by Maris Fogels
Added a new target for running the test suite in an ec2 image. Removed the WindmillLayer from that target. Fixed up the Makefile API a bit.
104
8514.1.1 by Barry Warsaw
By default, disable the entire MailmanLayer tests. Most of these tests are
105
check_mailman: build
106
	# Run all tests, including the Mailman integration
107
	# tests. test_on_merge.py takes care of setting up the database.
10870.1.1 by Maris Fogels
Added a new target for running the test suite in an ec2 image. Removed the WindmillLayer from that target. Fixed up the Makefile API a bit.
108
	${PY} -t ./test_on_merge.py $(VERBOSITY) $(TESTOPTS) \
109
		--layer=MailmanLayer
8514.1.1 by Barry Warsaw
By default, disable the entire MailmanLayer tests. Most of these tests are
110
11944.1.1 by Martin Pool
Further updates to parallel Make:
111
lint: ${PY}
8567.1.1 by Gary Poster
fix lint
112
	@bash ./bin/lint.sh
2513 by Canonical.com Patch Queue Manager
[trivial] Implement make lintmerge.
113
11944.1.1 by Martin Pool
Further updates to parallel Make:
114
lint-verbose: ${PY}
8567.1.1 by Gary Poster
fix lint
115
	@bash ./bin/lint.sh -v
4935.3.3 by Curtis Hovey
Updated a few files to illustrate how lint works.
116
12408.1.7 by Jonathan Lange
More stuff that we can just autogenerate
117
logs:
118
	mkdir logs
119
11944.1.1 by Martin Pool
Further updates to parallel Make:
120
xxxreport: $(PY)
9641.1.13 by Gary Poster
try a work-around for Hardy Heron dislike of scripts as executables in shebang lines. Also revert to using a shell script for bin/py rather than a Python script.
121
	${PY} -t ./utilities/xxxreport.py -f csv -o xxx-report.csv ./
6912.5.12 by Curtis Hovey
Revised Makefile rules for xxxreport.
122
11944.1.1 by Martin Pool
Further updates to parallel Make:
123
check-configs: $(PY)
8234.1.2 by Gary Poster
checkpoint: this initial buildout variant has several parts working, including run, start, stop, and harness.
124
	${PY} utilities/check-configs.py
4895.2.2 by Barry Warsaw
SteveA suggests checking config files in two ways:
125
1746 by Canonical.com Patch Queue Manager
[r=jamesh] Simple database restoration script and sampledata fixes
126
pagetests: build
8234.1.4 by Gary Poster
test works, nominally; and bin/py is a bit more functional. problems with import warnings are more serious because they cause tests to fail.
127
	env PYTHONPATH=$(PYTHONPATH) bin/test test_pages
3044.1.15 by James Troup
Fix 'suspicious' line in Makefile to quiet emacs
128
12408.1.7 by Jonathan Lange
More stuff that we can just autogenerate
129
inplace: build logs clean_logs
11968.1.1 by Tim Penhey
Make the codehosting directory and the rewrite file when making 'build'. This avoids the problem when apache makes the rewrite file and you can't remove it without sudo.
130
	mkdir -p $(CODEHOSTING_ROOT)/mirrors
11968.1.2 by Tim Penhey
Reordering rules.
131
	mkdir -p $(CODEHOSTING_ROOT)/config
132
	mkdir -p /var/tmp/bzrsync
11968.1.1 by Tim Penhey
Make the codehosting directory and the rewrite file when making 'build'. This avoids the problem when apache makes the rewrite file and you can't remove it without sudo.
133
	touch $(CODEHOSTING_ROOT)/rewrite.log
134
	chmod 777 $(CODEHOSTING_ROOT)/rewrite.log
11968.1.2 by Tim Penhey
Reordering rules.
135
	touch $(CODEHOSTING_ROOT)/config/launchpad-lookup.txt
136
12703.1.1 by Brad Crittenden
Fix Makefile rules to build icon-sprites
137
build: compile apidoc jsbuild css_combine sprite_image
7675.438.2 by Guilherme Salgado
Combine all the css files we need in a single combo.css, which is now the only one included in our base template
138
13314.3.1 by Ian Booth
Add js build tools
139
# LP_SOURCEDEPS_PATH should point to the sourcecode directory, but we
140
# want the parent directory where the download-cache and eggs directory
141
# are. We re-use the variable that is using for the rocketfuel-get script.
142
download-cache:
143
ifdef LP_SOURCEDEPS_PATH
144
	utilities/link-external-sourcecode $(LP_SOURCEDEPS_PATH)/..
145
else
146
	@echo "Missing ./download-cache."
147
	@echo "Developers: please run utilities/link-external-sourcecode."
148
	@exit 1
149
endif
150
7675.573.1 by Edwin Grubbs
Run buildout if sprite-util does not exist.
151
css_combine: sprite_css bin/combine-css
7675.438.2 by Guilherme Salgado
Combine all the css files we need in a single combo.css, which is now the only one included in our base template
152
	${SHHH} bin/combine-css
9570.14.1 by Bjorn Tillenius
Use lazr-js as an egg.
153
12622.4.1 by Curtis Hovey
Extracted sprite css to sprite.css.
154
sprite_css: ${LP_BUILT_JS_ROOT}/sprite.css
7675.507.27 by Edwin Grubbs
Prevent "make sprite_css" from running unnecessarily.
155
12702.1.4 by Brad Crittenden
Per review: combined makefile rules, removed use of 'cmp' in sorted()
156
${LP_BUILT_JS_ROOT}/sprite.css: bin/sprite-util ${ICING}/sprite.css.in \
157
		${ICING}/icon-sprites.positioning
7675.507.20 by Edwin Grubbs
Generating css correctly.
158
	${SHHH} bin/sprite-util create-css
159
12702.1.3 by Brad Crittenden
Removed icon-sprites.positioning and updated makefile rules to generated as needed.
160
sprite_image: ${ICING}/icon-sprites ${ICING}/icon-sprites.positioning
161
13171.1.1 by William Grant
Rebuild icon-sprites(.positioning) on sprite.css.in changes.
162
${ICING}/icon-sprites.positioning ${ICING}/icon-sprites: bin/sprite-util \
163
		${ICING}/sprite.css.in
7675.507.23 by Edwin Grubbs
Completely working.
164
	${SHHH} bin/sprite-util create-image
165
13314.10.1 by Ian Booth
Move lazr widgets up from lazr dir and remove lazr build steps
166
jsbuild_widget_css: bin/jsbuild
13314.5.2 by Ian Booth
Add buildout support
167
	${SHHH} bin/jsbuild \
13444.4.2 by Gavin Panella
Allow *.*.js in launchpad.js, and clean up Makefile a little bit.
168
	    --srcdir lib/lp/app/javascript \
13314.10.1 by Ian Booth
Move lazr widgets up from lazr dir and remove lazr build steps
169
	    --builddir $(LP_BUILT_JS_ROOT)
12581.1.3 by Gavin Panella
Get most javascript building according to JS_BUILD.
170
13314.10.1 by Ian Booth
Move lazr widgets up from lazr dir and remove lazr build steps
171
$(JS_LP): jsbuild_widget_css
12581.1.3 by Gavin Panella
Get most javascript building according to JS_BUILD.
172
173
$(JS_OUT): $(JS_ALL)
174
ifeq ($(JS_BUILD), min)
13361.1.1 by William Grant
Fix -m jsmin to -m lp.scripts.utilities.js.jsmin (it used to live in the root directory of lazr-js). Unbreaks production JS generation.
175
	cat $^ | $(PY) -m lp.scripts.utilities.js.jsmin > $@
12581.1.3 by Gavin Panella
Get most javascript building according to JS_BUILD.
176
else
13517.1.1 by Gavin Panella
Stop endlessly appending to launchpad.js.
177
	awk 'FNR == 1 {print "/* " FILENAME " */"} {print}' $^ > $@
12581.1.3 by Gavin Panella
Get most javascript building according to JS_BUILD.
178
endif
179
13314.5.2 by Ian Booth
Add buildout support
180
jsbuild: $(PY) $(JS_OUT)
6920.1.7 by Leonard Richardson
Fixed the makefile to run apidoc when building.
181
8329.1.7 by Gary Poster
convert layout to have eggs and download-cache on top; and add make target for eggs folder, for deployment.
182
eggs:
8357.5.18 by Gary Poster
fix buildout issues
183
	# Usually this is linked via link-external-sourcecode, but in
8329.1.7 by Gary Poster
convert layout to have eggs and download-cache on top; and add make target for eggs folder, for deployment.
184
	# deployment we create this ourselves.
185
	mkdir eggs
13314.4.19 by Ian Booth
Fix yui link
186
	mkdir yui
8329.1.7 by Gary Poster
convert layout to have eggs and download-cache on top; and add make target for eggs folder, for deployment.
187
11944.1.1 by Martin Pool
Further updates to parallel Make:
188
buildonce_eggs: $(PY)
10016.1.1 by Gary Poster
make target for building eggs once
189
	find eggs -name '*.pyc' -exec rm {} \;
190
8329.1.7 by Gary Poster
convert layout to have eggs and download-cache on top; and add make target for eggs folder, for deployment.
191
# The download-cache dependency comes *before* eggs so that developers get the
11926.6.2 by Jeroen Vermeulen
Review change, and lint.
192
# warning before the eggs directory is made.  The target for the eggs
193
# directory is only there for deployment convenience.
11474.1.3 by Gary Poster
fix Makefile change and add comment
194
# Note that the buildout version must be maintained here and in versions.cfg
195
# to make sure that the build does not go over the network.
11944.1.1 by Martin Pool
Further updates to parallel Make:
196
#
197
# buildout won't touch files that would have the same contents, but for Make's
198
# sake we need them to get fresh timestamps, so we touch them after building.
8329.1.7 by Gary Poster
convert layout to have eggs and download-cache on top; and add make target for eggs folder, for deployment.
199
bin/buildout: download-cache eggs
9097.1.1 by Gary Poster
squelch PYTHONPATH from our scripts. That was a bad idea; will revert in zc.buildout
200
	$(SHHH) PYTHONPATH= $(PYTHON) bootstrap.py\
10303.1.10 by Gary Poster
update to newer version of buildout branch
201
		--setup-source=ez_setup.py \
11474.1.3 by Gary Poster
fix Makefile change and add comment
202
		--download-base=download-cache/dist --eggs=eggs \
11474.1.1 by Gary Poster
upgrade to newer versions of libraries
203
		--version=1.5.1
11944.1.1 by Martin Pool
Further updates to parallel Make:
204
	touch --no-create $@
8329.1.2 by Gary Poster
specify zope.interface version; make bootstrap and buildout only called when necessary from make file; make change to rocketfuel config file unnecessary, so rocketfuel-setup does not need to be called; make twistd calls include sys.path in PYTHONPATH.
205
10916.1.2 by Gary Poster
add comments per review
206
# This target is used by LOSAs to prepare a build to be pushed out to
207
# destination machines.  We only want eggs: they are the expensive bits,
208
# and the other bits might run into problems like bug 575037.  This
209
# target runs buildout, and then removes everything created except for
210
# the eggs.
11944.1.1 by Martin Pool
Further updates to parallel Make:
211
build_eggs: $(BUILDOUT_BIN)
10916.1.1 by Gary Poster
Make a new build target to allow LOSAs to pre-build eggs without pre-building scripts.
212
7675.573.1 by Edwin Grubbs
Run buildout if sprite-util does not exist.
213
# This builds bin/py and all the other bin files except bin/buildout.
10469.1.1 by Edwin Grubbs
Not really working yet.
214
# Remove the target before calling buildout to ensure that buildout
215
# updates the timestamp.
11944.1.1 by Martin Pool
Further updates to parallel Make:
216
buildout_bin: $(BUILDOUT_BIN)
217
218
# buildout won't touch files that would have the same contents, but for Make's
219
# sake we need them to get fresh timestamps, so we touch them after building.
220
#
221
# If we listed every target on the left-hand side, a parallel make would try
222
# multiple copies of this rule to build them all.  Instead, we nominally build
223
# just $(PY), and everything else is implicitly updated by that.
224
$(PY): bin/buildout versions.cfg $(BUILDOUT_CFG) setup.py \
11926.6.2 by Jeroen Vermeulen
Review change, and lint.
225
		$(BUILDOUT_TEMPLATES)
9097.1.1 by Gary Poster
squelch PYTHONPATH from our scripts. That was a bad idea; will revert in zc.buildout
226
	$(SHHH) PYTHONPATH= ./bin/buildout \
227
                configuration:instance_name=${LPCONFIG} -c $(BUILDOUT_CFG)
11944.1.1 by Martin Pool
Further updates to parallel Make:
228
	touch $@
229
230
$(subst $(PY),,$(BUILDOUT_BIN)): $(PY)
8329.1.2 by Gary Poster
specify zope.interface version; make bootstrap and buildout only called when necessary from make file; make change to rocketfuel config file unnecessary, so rocketfuel-setup does not need to be called; make twistd calls include sys.path in PYTHONPATH.
231
11944.1.1 by Martin Pool
Further updates to parallel Make:
232
compile: $(PY) $(BZR_VERSION_INFO)
1831 by Canonical.com Patch Queue Manager
New config machinery, database helpers and oddsnsods required for staging
233
	${SHHH} $(MAKE) -C sourcecode build PYTHON=${PYTHON} \
10637.3.3 by Guilherme Salgado
Get rid of PYTHON_VERSION from all Makefiles and use a customized pygettextpo which uses the default system python instead of what's defined in PYTHON_VERSION
234
	    LPCONFIG=${LPCONFIG}
9641.1.13 by Gary Poster
try a work-around for Hardy Heron dislike of scripts as executables in shebang lines. Also revert to using a shell script for bin/py rather than a Python script.
235
	${SHHH} LPCONFIG=${LPCONFIG} ${PY} -t buildmailman.py
1102 by Canonical.com Patch Queue Manager
Lucille had some XXXs which should have been NOTEs
236
237
test_build: build
8234.1.4 by Gary Poster
test works, nominally; and bin/py is a bit more functional. problems with import warnings are more serious because they cause tests to fail.
238
	bin/test $(TESTFLAGS) $(TESTOPTS)
1102 by Canonical.com Patch Queue Manager
Lucille had some XXXs which should have been NOTEs
239
240
test_inplace: inplace
8234.1.4 by Gary Poster
test works, nominally; and bin/py is a bit more functional. problems with import warnings are more serious because they cause tests to fail.
241
	bin/test $(TESTFLAGS) $(TESTOPTS)
1102 by Canonical.com Patch Queue Manager
Lucille had some XXXs which should have been NOTEs
242
243
ftest_build: build
8234.1.4 by Gary Poster
test works, nominally; and bin/py is a bit more functional. problems with import warnings are more serious because they cause tests to fail.
244
	bin/test -f $(TESTFLAGS) $(TESTOPTS)
1102 by Canonical.com Patch Queue Manager
Lucille had some XXXs which should have been NOTEs
245
246
ftest_inplace: inplace
8234.1.4 by Gary Poster
test works, nominally; and bin/py is a bit more functional. problems with import warnings are more serious because they cause tests to fail.
247
	bin/test -f $(TESTFLAGS) $(TESTOPTS)
1102 by Canonical.com Patch Queue Manager
Lucille had some XXXs which should have been NOTEs
248
7675.624.31 by Tim Penhey
Make the makefile use the correct name for the merge proposal job script.
249
merge-proposal-jobs:
7675.624.12 by Tim Penhey
Rename mpcreationjobs -> merge-proposal-email-jobs.
250
	# Handle merge proposal email jobs.
7675.624.38 by Tim Penhey
Make the merge-proposal-job script run verbosely.
251
	$(PY) cronscripts/merge-proposal-jobs.py -v
9750.3.1 by Aaron Bentley
Add mpcreationsjobs to sync_branches make target
252
13646.2.1 by Gavin Panella
Remove check_schema Makefile target.
253
run: build inplace stop
14032.1.1 by Raphael Badin
Add TxLongPollServer.
254
	bin/run -r librarian,google-webservice,memcached,rabbitmq,txlongpoll -i $(LPCONFIG)
4004.3.14 by jml at canonical
'make run' only runs webserver & librarian. 'make run_all' runs everything.
255
13992.1.1 by Gary Poster
Add yui xhr integration test support.
256
run-testapp: LPCONFIG=testrunner-appserver
257
run-testapp: build inplace stop
14151.2.2 by Gary Poster
merge trunk, resolving conflicts
258
	LPCONFIG=$(LPCONFIG) INTERACTIVE_TESTS=1 bin/run-testapp \
259
	-r memcached -i $(LPCONFIG)
13992.1.1 by Gary Poster
Add yui xhr integration test support.
260
12408.1.5 by Jonathan Lange
Delete 'run.gdb'. We can just make it as we need it.
261
run.gdb:
262
	echo 'run' > run.gdb
263
13646.2.1 by Gavin Panella
Remove check_schema Makefile target.
264
start-gdb: build inplace stop support_files run.gdb
8690.4.2 by Francis J. Lacoste
Add a -i command line argument that sets the instance name.
265
	nohup gdb -x run.gdb --args bin/run -i $(LPCONFIG) \
8665.1.3 by Francis J. Lacoste
Automatically set the ZConfig configuration file.
266
		-r librarian,google-webservice
6781.1.1 by Herb McNew
Applied the patch that kiko provided and that was tested on staging. Allows us to run an app server instance under gdb.
267
		> ${LPCONFIG}-nohup.out 2>&1 &
268
13646.2.1 by Gavin Panella
Remove check_schema Makefile target.
269
run_all: build inplace stop
13618.2.1 by Gary Poster
Make ++profile++ use standard page templates, not chameleon, to remove template compilation step in Makefile
270
	bin/run \
14032.1.1 by Raphael Badin
Add TxLongPollServer.
271
	 -r librarian,sftp,forker,mailman,codebrowse,google-webservice,memcached,rabbitmq,txlongpoll \
13618.2.1 by Gary Poster
Make ++profile++ use standard page templates, not chameleon, to remove template compilation step in Makefile
272
	 -i $(LPCONFIG)
7528.1.6 by Michael Hudson
document new config schema values
273
7551.3.10 by Michael Hudson
the real world meets the makefile
274
run_codebrowse: build
9590.1.135 by Michael Hudson
add files from launchpad-loggerhead tree to launchpad tree
275
	BZR_PLUGIN_PATH=bzrplugins $(PY) scripts/start-loggerhead.py -f
7528.1.1 by Michael Hudson
add makefile targets and symlinks for running loggerhead in the launchpad tree
276
7551.3.10 by Michael Hudson
the real world meets the makefile
277
start_codebrowse: build
9590.1.135 by Michael Hudson
add files from launchpad-loggerhead tree to launchpad tree
278
	BZR_PLUGIN_PATH=$(shell pwd)/bzrplugins $(PY) scripts/start-loggerhead.py
7528.1.1 by Michael Hudson
add makefile targets and symlinks for running loggerhead in the launchpad tree
279
280
stop_codebrowse:
9590.1.135 by Michael Hudson
add files from launchpad-loggerhead tree to launchpad tree
281
	$(PY) scripts/stop-loggerhead.py
7528.1.1 by Michael Hudson
add makefile targets and symlinks for running loggerhead in the launchpad tree
282
13646.2.1 by Gavin Panella
Remove check_schema Makefile target.
283
run_codehosting: build inplace stop
11149.12.32 by John Arbash Meinel
I think I have the endpoints connected up.
284
	bin/run -r librarian,sftp,forker,codebrowse -i $(LPCONFIG)
10289.1.2 by Paul Hummer
Added a run_codehosting make target that just runs the codehosting essentials
285
7675.717.1 by Tom Haddon
For the librarian startup, we only need to compile, not to build
286
start_librarian: compile
8971.2.1 by Stuart Bishop
Add Librarian startup script
287
	bin/start_librarian
288
289
stop_librarian:
290
	bin/killservice librarian
291
7182.3.1 by Gary Poster
sketch to fix bugs 245368 and 268446.
292
pull_branches: support_files
9580.4.1 by Henning Eggers
Fix the bug.
293
	$(PY) cronscripts/supermirror-pull.py
4706.2.8 by Jonathan Lange
Add 'pull', 'scan' and 'rewritemap' targets to Makefile.
294
7735.2.2 by Michael Hudson
bye bye more stuff
295
scan_branches:
4706.2.11 by Jonathan Lange
Add comments and a sync_branches target that does a pull and scan.
296
	# Scan branches from the filesystem into the database.
7675.458.10 by Paul Hummer
Added changed the Makefile rule to use the new script.
297
	$(PY) cronscripts/scan_branches.py
4706.2.8 by Jonathan Lange
Add 'pull', 'scan' and 'rewritemap' targets to Makefile.
298
7675.624.31 by Tim Penhey
Make the makefile use the correct name for the merge proposal job script.
299
sync_branches: pull_branches scan_branches merge-proposal-jobs
4706.2.11 by Jonathan Lange
Add comments and a sync_branches target that does a pull and scan.
300
7430.1.3 by Gavin Panella
Post-review changes, and a few others.
301
$(BZR_VERSION_INFO):
7176.4.1 by Tom Haddon
Only create/recreate the bzr_version_info file if it's changed/needed
302
	scripts/update-bzr-version-info.sh
809 by Canonical.com Patch Queue Manager
Nuke some arch-tags
303
10466.8.8 by Leonard Richardson
Removed reference to DEVEL_WADL_FILE.
304
support_files: $(API_INDEX) $(BZR_VERSION_INFO)
7182.3.1 by Gary Poster
sketch to fix bugs 245368 and 268446.
305
8777.3.2 by Tom Haddon
Clean up make stop and make start by having them use the initscript-stop and initscript-start targets so we're not duplicating. Also clean up the comments for those as appropriate
306
# Intended for use on developer machines
307
start: inplace stop support_files initscript-start
308
1884 by Canonical.com Patch Queue Manager
[trivial] run-as-daemon targets
309
# Run as a daemon - hack using nohup until we move back to using zdaemon
7182.3.1 by Gary Poster
sketch to fix bugs 245368 and 268446.
310
# properly. We also should really wait until services are running before
1937 by Canonical.com Patch Queue Manager
[r=jamesh] Common PID file handing module
311
# exiting, as running 'make stop' too soon after running 'make start'
8777.3.2 by Tom Haddon
Clean up make stop and make start by having them use the initscript-stop and initscript-start targets so we're not duplicating. Also clean up the comments for those as appropriate
312
# will not work as expected. For use on production servers, where
313
# we know we don't need the extra steps in a full "make start"
314
# because of how the code is deployed/built.
7182.3.1 by Gary Poster
sketch to fix bugs 245368 and 268446.
315
initscript-start:
8690.4.2 by Francis J. Lacoste
Add a -i command line argument that sets the instance name.
316
	nohup bin/run -i $(LPCONFIG) > ${LPCONFIG}-nohup.out 2>&1 &
7143.1.1 by Tom Haddon
Add stripped down version of 'make start' as 'make initscript-start' for use on production servers where dependencies used in 'make start' aren't needed
317
8777.3.2 by Tom Haddon
Clean up make stop and make start by having them use the initscript-stop and initscript-start targets so we're not duplicating. Also clean up the comments for those as appropriate
318
# Intended for use on developer machines
319
stop: build initscript-stop
320
1937 by Canonical.com Patch Queue Manager
[r=jamesh] Common PID file handing module
321
# Kill launchpad last - other services will probably shutdown with it,
8777.3.2 by Tom Haddon
Clean up make stop and make start by having them use the initscript-stop and initscript-start targets so we're not duplicating. Also clean up the comments for those as appropriate
322
# so killing them after is a race condition. For use on production
9012.1.10 by Maris Fogels
Made the jscheck target use bin/jstest
323
# servers, where we know we don't need the extra steps in a full
8777.3.2 by Tom Haddon
Clean up make stop and make start by having them use the initscript-stop and initscript-start targets so we're not duplicating. Also clean up the comments for those as appropriate
324
# "make stop" because of how the code is deployed/built.
8777.3.1 by Tom Haddon
Create an initscript-stop target for use on production servers
325
initscript-stop:
10693.1.1 by William Grant
Remove all of buildd-sequencer, except the config keys (due to bug #557271).
326
	bin/killservice librarian launchpad mailman
8777.3.1 by Tom Haddon
Create an initscript-stop target for use on production servers
327
5447.1.1 by Tom Haddon
Adding shutdown option to makefile
328
shutdown: scheduleoutage stop
7430.1.1 by Gavin Panella
Clean up the Makefile, including splittig the API doc task into three.
329
	$(RM) +maintenancetime.txt
5447.1.1 by Tom Haddon
Adding shutdown option to makefile
330
331
scheduleoutage:
5447.1.2 by Tom Haddon
Constant for shutdown and correct path locations
332
	echo Scheduling outage in ${MINS_TO_SHUTDOWN} mins
333
	date --iso-8601=minutes -u -d +${MINS_TO_SHUTDOWN}mins > +maintenancetime.txt
334
	echo Sleeping ${MINS_TO_SHUTDOWN} mins
335
	sleep ${MINS_TO_SHUTDOWN}m
5447.1.1 by Tom Haddon
Adding shutdown option to makefile
336
7675.573.1 by Edwin Grubbs
Run buildout if sprite-util does not exist.
337
harness: bin/harness
8234.1.2 by Gary Poster
checkpoint: this initial buildout variant has several parts working, including run, start, stop, and harness.
338
	bin/harness
1716.5.37 by kiko
Add harness Makefile convenience shortcut
339
7675.573.1 by Edwin Grubbs
Run buildout if sprite-util does not exist.
340
iharness: bin/iharness
8234.1.2 by Gary Poster
checkpoint: this initial buildout variant has several parts working, including run, start, stop, and harness.
341
	bin/iharness
3673.1.10 by David Allouche
add iharness target to ./Makefile, that runs ipython instead of plain python
342
1716.5.42 by kiko
Add a rebuildfti Makefile target, and make newsampledata use it
343
rebuildfti:
344
	@echo Rebuilding FTI indexes on launchpad_dev database
8234.1.2 by Gary Poster
checkpoint: this initial buildout variant has several parts working, including run, start, stop, and harness.
345
	$(PY) database/schema/fti.py -d launchpad_dev --force
1716.5.42 by kiko
Add a rebuildfti Makefile target, and make newsampledata use it
346
9887.2.1 by Gary Poster
Makefile for making Python 2.5 a smoother transition
347
clean_js:
12581.1.3 by Gavin Panella
Get most javascript building according to JS_BUILD.
348
	$(RM) $(JS_OUT)
9887.2.1 by Gary Poster
Makefile for making Python 2.5 a smoother transition
349
	$(RM) -r $(LAZR_BUILT_JS_ROOT)
350
10916.1.1 by Gary Poster
Make a new build target to allow LOSAs to pre-build eggs without pre-building scripts.
351
clean_buildout:
352
	$(RM) -r bin
353
	$(RM) -r parts
354
	$(RM) -r develop-eggs
355
	$(RM) .installed.cfg
356
	$(RM) -r build
357
	$(RM) _pythonpath.py
13314.4.16 by Ian Booth
Fix yui packaging
358
	$(RM) -r yui/*
10916.1.1 by Gary Poster
Make a new build target to allow LOSAs to pre-build eggs without pre-building scripts.
359
12408.1.6 by Jonathan Lange
Factor out some of the log cleaning
360
clean_logs:
361
	$(RM) logs/thread*.request
362
363
clean: clean_js clean_buildout clean_logs
7430.1.1 by Gavin Panella
Clean up the Makefile, including splittig the API doc task into three.
364
	$(MAKE) -C sourcecode/pygettextpo clean
9887.2.1 by Gary Poster
Makefile for making Python 2.5 a smoother transition
365
	# XXX gary 2009-11-16 bug 483782
366
	# The pygettextpo Makefile should have this next line in it for its make
367
	# clean, and then we should remove this line.
368
	$(RM) sourcecode/pygpgme/gpgme/*.so
9141.1.1 by Francis J. Lacoste
Only run make clean for Mailman if the Makefile has been created.
369
	if test -f sourcecode/mailman/Makefile; then \
370
		$(MAKE) -C sourcecode/mailman clean; \
371
	fi
9098.3.1 by Francis J. Lacoste
Don't clean eggs in make clean. Properly clean mailman.
372
	find . -path ./eggs -prune -false -o \
373
		-type f \( -name '*.o' -o -name '*.so' -o -name '*.la' -o \
13618.2.1 by Gary Poster
Make ++profile++ use standard page templates, not chameleon, to remove template compilation step in Makefile
374
	    -name '*.lo' -o -name '*.py[co]' -o -name '*.dll' \) \
7430.1.1 by Gavin Panella
Clean up the Makefile, including splittig the API doc task into three.
375
	    -print0 | xargs -r0 $(RM)
8294.7.14 by Francis J. Lacoste
Clean a lot of junk directories in /var/tmp that can cause trouble.
376
	$(RM) -r lib/mailman
14320.1.1 by Steve Kowalik
Fix expansion issue in Makefile.
377
	$(RM) -r $(LP_BUILT_JS_ROOT)/*
378
	$(RM) -r $(CODEHOSTING_ROOT)
379
	$(RM) -r $(APIDOC_DIR)
380
	$(RM) -r $(APIDOC_DIR).tmp
7430.1.3 by Gavin Panella
Post-review changes, and a few others.
381
	$(RM) $(BZR_VERSION_INFO)
10713.1.1 by Gary Poster
use new version of z3c.recipe.filetemplate and zc.buildout fork to use relative paths.
382
	$(RM) +config-overrides.zcml
14320.1.1 by Steve Kowalik
Fix expansion issue in Makefile.
383
	$(RM) -r \
8294.7.14 by Francis J. Lacoste
Clean a lot of junk directories in /var/tmp that can cause trouble.
384
			  /var/tmp/builddmaster \
385
			  /var/tmp/bzrsync \
386
			  /var/tmp/codehosting.test \
387
			  /var/tmp/codeimport \
11737.4.2 by Robert Collins
fatsam.appserver isn't used anywhere.
388
			  /var/tmp/fatsam.test \
8294.7.14 by Francis J. Lacoste
Clean a lot of junk directories in /var/tmp that can cause trouble.
389
			  /var/tmp/lperr \
390
			  /var/tmp/lperr.test \
391
			  /var/tmp/mailman \
392
			  /var/tmp/mailman-xmlrpc.test \
393
			  /var/tmp/ppa \
394
			  /var/tmp/ppa.test \
12398.1.13 by Jonathan Lange
Rename zeca config section and use a different path by default.
395
			  /var/tmp/testkeyserver
10546.1.2 by Michael Hudson
run tests in ec2 with /var/tmp/launchpad_mailqueue read-only
396
	# /var/tmp/launchpad_mailqueue is created read-only on ec2test
397
	# instances.
12702.1.4 by Brad Crittenden
Per review: combined makefile rules, removed use of 'cmp' in sorted()
398
	if [ -w /var/tmp/launchpad_mailqueue ]; then \
14320.1.1 by Steve Kowalik
Fix expansion issue in Makefile.
399
		$(RM) -r /var/tmp/launchpad_mailqueue; \
12702.1.4 by Brad Crittenden
Per review: combined makefile rules, removed use of 'cmp' in sorted()
400
	fi
10546.1.2 by Michael Hudson
run tests in ec2 with /var/tmp/launchpad_mailqueue read-only
401
1102 by Canonical.com Patch Queue Manager
Lucille had some XXXs which should have been NOTEs
402
403
realclean: clean
7430.1.1 by Gavin Panella
Clean up the Makefile, including splittig the API doc task into three.
404
	$(RM) TAGS tags
1102 by Canonical.com Patch Queue Manager
Lucille had some XXXs which should have been NOTEs
405
406
zcmldocs:
7430.1.3 by Gavin Panella
Post-review changes, and a few others.
407
	mkdir -p doc/zcml/namespaces.zope.org
8234.1.4 by Gary Poster
test works, nominally; and bin/py is a bit more functional. problems with import warnings are more serious because they cause tests to fail.
408
	bin/stxdocs \
7430.1.3 by Gavin Panella
Post-review changes, and a few others.
409
	    -f sourcecode/zope/src/zope/app/zcmlfiles/meta.zcml \
410
	    -o doc/zcml/namespaces.zope.org
1102 by Canonical.com Patch Queue Manager
Lucille had some XXXs which should have been NOTEs
411
2237 by Canonical.com Patch Queue Manager
[trivial] Libraraian upstream tweaks, which demonstrate the the feature is broken (?)
412
potemplates: launchpad.pot
413
414
# Generate launchpad.pot by extracting message ids from the source
415
launchpad.pot:
8234.1.4 by Gary Poster
test works, nominally; and bin/py is a bit more functional. problems with import warnings are more serious because they cause tests to fail.
416
	bin/i18nextract.py
1102 by Canonical.com Patch Queue Manager
Lucille had some XXXs which should have been NOTEs
417
9948.1.1 by Maris Fogels
Make the apache process restart after installing the new configuration and modules, to prevent the new modules from segfaulting because of bugs.
418
# Called by the rocketfuel-setup script. You probably don't want to run this
419
# on its own.
5543.3.2 by Tim Penhey
Alterations to the way codebrowse is started, and updating rocketfuel-setup
420
install: reload-apache
421
6991.1.1 by Guilherme Salgado
Serve *.launchpad.dev through https
422
copy-certificates:
7029.3.3 by Henning Eggers
Added creation of /etc/apache/ssl directory to Makefile before copying files there, as it might not exist.
423
	mkdir -p /etc/apache2/ssl
6991.1.1 by Guilherme Salgado
Serve *.launchpad.dev through https
424
	cp configs/development/launchpad.crt /etc/apache2/ssl/
425
	cp configs/development/launchpad.key /etc/apache2/ssl/
426
427
copy-apache-config:
7459.5.19 by Michael Hudson
mandatory sed-implied comment
428
	# We insert the absolute path to the branch-rewrite script
429
	# into the Apache config as we copy the file into position.
13333.9.1 by Gavin Panella
Fix lint.
430
	sed -e 's,%BRANCH_REWRITE%,$(shell pwd)/scripts/branch-rewrite.py,' \
431
		configs/development/local-launchpad-apache > \
432
		/etc/apache2/sites-available/local-launchpad
8898.1.1 by Michael Hudson
chown the log file when installing the apache config
433
	touch /var/tmp/bazaar.launchpad.dev/rewrite.log
434
	chown $(SUDO_UID):$(SUDO_GID) /var/tmp/bazaar.launchpad.dev/rewrite.log
6991.1.1 by Guilherme Salgado
Serve *.launchpad.dev through https
435
436
enable-apache-launchpad: copy-apache-config copy-certificates
5543.3.2 by Tim Penhey
Alterations to the way codebrowse is started, and updating rocketfuel-setup
437
	a2ensite local-launchpad
438
6991.1.1 by Guilherme Salgado
Serve *.launchpad.dev through https
439
reload-apache: enable-apache-launchpad
9948.1.1 by Maris Fogels
Make the apache process restart after installing the new configuration and modules, to prevent the new modules from segfaulting because of bugs.
440
	/etc/init.d/apache2 restart
5543.3.2 by Tim Penhey
Alterations to the way codebrowse is started, and updating rocketfuel-setup
441
8234.1.6 by Gary Poster
fold bin/py into compile
442
TAGS: compile
8234.1.5 by Gary Poster
slight clean up.
443
	# emacs tags
444
	bin/tags -e
445
8234.1.6 by Gary Poster
fold bin/py into compile
446
tags: compile
8234.1.5 by Gary Poster
slight clean up.
447
	# vi tags
448
	bin/tags -v
449
8234.1.6 by Gary Poster
fold bin/py into compile
450
ID: compile
8234.1.5 by Gary Poster
slight clean up.
451
	# idutils ID file
452
	bin/tags -i
1102 by Canonical.com Patch Queue Manager
Lucille had some XXXs which should have been NOTEs
453
10840.1.2 by Jelmer Vernooij
Use the same pydoctor command Michael uses to generate http://people.canonical.com/~mwh/canonicalapi/
454
PYDOCTOR = pydoctor
10870.1.1 by Maris Fogels
Added a new target for running the test suite in an ec2 image. Removed the WindmillLayer from that target. Fixed up the Makefile API a bit.
455
PYDOCTOR_OPTIONS =
10529.3.1 by Jonathan Lange
Add Make targets to generate package dependency graphs with snakefood
456
10840.1.1 by Jelmer Vernooij
Add pydoctor rule.
457
pydoctor:
10840.1.2 by Jelmer Vernooij
Use the same pydoctor command Michael uses to generate http://people.canonical.com/~mwh/canonicalapi/
458
	$(PYDOCTOR) --make-html --html-output=apidocs --add-package=lib/lp \
459
		--add-package=lib/canonical --project-name=Launchpad \
460
		--docformat restructuredtext --verbose-about epytext-summary \
461
		$(PYDOCTOR_OPTIONS)
10840.1.1 by Jelmer Vernooij
Add pydoctor rule.
462
13992.1.1 by Gary Poster
Add yui xhr integration test support.
463
.PHONY: apidoc build_eggs buildonce_eggs buildout_bin check check	\
464
	check_config check_mailman clean clean_buildout clean_js	\
465
	clean_logs compile css_combine debug default doc ftest_build	\
466
	ftest_inplace hosted_branches jsbuild jsbuild_widget_css	\
467
	launchpad.pot pagetests pull_branches pydoctor realclean	\
468
	reload-apache run run-testapp runner scan_branches schema	\
469
	sprite_css sprite_image start stop sync_branches TAGS tags	\
470
	test_build test_inplace zcmldocs