~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
1770 by Canonical.com Patch Queue Manager
[trivial] Move to Python 2.4
4
PYTHON_VERSION=2.4
1746 by Canonical.com Patch Queue Manager
[r=jamesh] Simple database restoration script and sampledata fixes
5
PYTHON=python${PYTHON_VERSION}
3691.187.3 by Stuart Bishop
PYTHONPATH tweaks
6
PYTHONPATH:=$(shell pwd)/lib:${PYTHONPATH}
1716.1.49 by Christian Reis
Removing cruft from the main Makefile
7
1102 by Canonical.com Patch Queue Manager
Lucille had some XXXs which should have been NOTEs
8
TESTFLAGS=-p -v
9
TESTOPTS=
1716.1.49 by Christian Reis
Removing cruft from the main Makefile
10
11
SHHH=${PYTHON} utilities/shhh.py
12
STARTSCRIPT=runlaunchpad.py
1102 by Canonical.com Patch Queue Manager
Lucille had some XXXs which should have been NOTEs
13
Z3LIBPATH=$(shell pwd)/sourcecode/zope/src
14
HERE:=$(shell pwd)
1716.1.49 by Christian Reis
Removing cruft from the main Makefile
15
1831 by Canonical.com Patch Queue Manager
New config machinery, database helpers and oddsnsods required for staging
16
LPCONFIG=default
17
CONFFILE=configs/${LPCONFIG}/launchpad.conf
1102 by Canonical.com Patch Queue Manager
Lucille had some XXXs which should have been NOTEs
18
63.1.71 by Robert Collins
do not make check by default "make" invocation
19
# DO NOT ALTER : this should just build by default
20
default: inplace
1102 by Canonical.com Patch Queue Manager
Lucille had some XXXs which should have been NOTEs
21
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>
22
schema: build
23
	$(MAKE) -C database/schema
1716.1.42 by Christian Reis
merged and unconflicted
24
1716.5.35 by kiko
Add for convenience a newsampledata proxy target to the main Makefile.
25
newsampledata:
26
	$(MAKE) -C database/schema newsampledata
27
3504.1.55 by kiko
Implement half of https://launchpad.net/products/launchpad/+spec/stop-spurious-test-failures by adding a special Makefile target that doesn't run some of the sourcecode tets.
28
check_launchpad_on_merge: build check importdcheck hctcheck
29
	# Use the check_for_launchpad rule which runs tests over a smaller
30
	# set of libraries, for performance and reliability reasons.
31
	$(MAKE) -C sourcecode check_for_launchpad PYTHON=${PYTHON} \
32
		PYTHON_VERSION=${PYTHON_VERSION} PYTHONPATH=$(PYTHONPATH)
33
3691.1.251 by Steve Alexander
add makefile rule to ensure no merges from the ui branch
34
check_not_a_ui_merge:
35
	[ ! -f do-not-merge-to-mainline.txt ]
36
37
check_merge: check_not_a_ui_merge build check importdcheck hctcheck
3587.2.5 by Andrew Bennetts
Re-enable sourcecode/* and hct and sourcerer checks.
38
	# Work around the current idiom of 'make check' getting too long
39
	# because of hct and related tests. note that this is a short
40
	# term solution, the long term solution will need to be 
41
	# finer grained testing anyway.
42
	# Run all tests. test_on_merge.py takes care of setting up the
43
	# database.
3504.1.55 by kiko
Implement half of https://launchpad.net/products/launchpad/+spec/stop-spurious-test-failures by adding a special Makefile target that doesn't run some of the sourcecode tets.
44
	$(MAKE) -C sourcecode check PYTHON=${PYTHON} \
45
		PYTHON_VERSION=${PYTHON_VERSION} PYTHONPATH=$(PYTHONPATH)
46
3691.187.4 by Stuart Bishop
Rename makefile rule to be consistant
47
check_merge_edge: check_no_dbupdates check_merge
3691.187.2 by Stuart Bishop
Makefile entry for maintaining edge.launchpad.net branch
48
	# Allow the merge if there are no database updates, including
49
	# database patches or datamigration scripts (which should live
50
	# in database/schema/pending. Used for maintaining the
51
	# edge.lauchpad.net branch.
52
53
check_no_dbupdates:
3691.187.3 by Stuart Bishop
PYTHONPATH tweaks
54
	[ `PYTHONPATH= bzr status | grep database/schema/ | wc -l` -eq 0 ]
3691.187.2 by Stuart Bishop
Makefile entry for maintaining edge.launchpad.net branch
55
3504.1.55 by kiko
Implement half of https://launchpad.net/products/launchpad/+spec/stop-spurious-test-failures by adding a special Makefile target that doesn't run some of the sourcecode tets.
56
hctcheck: build
3587.2.5 by Andrew Bennetts
Re-enable sourcecode/* and hct and sourcerer checks.
57
	env PYTHONPATH=$(PYTHONPATH) \
58
	    ${PYTHON} -t ./test_on_merge.py -vv \
59
	        --dir hct --dir sourcerer
63.1.107 by Robert Collins
add check_merge target for pqm to use when merging - runs hct and related tests
60
3538.3.1 by Andrew Bennetts
Fix 'make importdcheck' by using the same path hack as test.py. Made the 'importdcheck' make rule a little more consistent with others, too.
61
importdcheck: build
62
	env PYTHONPATH=$(PYTHONPATH) \
3691.301.1 by David Allouche
experimental nested batch progress printer
63
	${PYTHON} -t ./lib/importd/test_all.py "$$TESTFILTER"
1810 by Canonical.com Patch Queue Manager
move importd code from buildbots tree to launchpad
64
63.1.94 by Robert Collins
enable cscvs and related test suites again
65
check: build
1102 by Canonical.com Patch Queue Manager
Lucille had some XXXs which should have been NOTEs
66
	# Run all tests. test_on_merge.py takes care of setting up the
2894.1.13 by Stuart Bishop
Make 'make check' log test times
67
	# database..
1377 by Canonical.com Patch Queue Manager
fix makefile setting of PYTHONPATH
68
	env PYTHONPATH=$(PYTHONPATH) \
2976.10.107 by Stuart Bishop
Merge from Rocketfuel
69
	${PYTHON} -t ./test_on_merge.py -vv
1102 by Canonical.com Patch Queue Manager
Lucille had some XXXs which should have been NOTEs
70
2279 by Canonical.com Patch Queue Manager
[trivial] add a make lint target (USE IT) and remove cruft
71
lint:
2513 by Canonical.com Patch Queue Manager
[trivial] Implement make lintmerge.
72
	@sh ./utilities/lint.sh
73
2976.10.108 by Stuart Bishop
Fix poexport-distrorelease-date-tarball test by including log output
74
#lintmerge:
75
#	@# Thank Stuart, not me!
76
#	@baz diff -s rocketfuel@canonical.com/launchpad--devel--0 | \
77
#		grep -v "^*" | \
78
#		grep -v "{arch}" | \
79
#		cut -c4- | \
80
#		xargs sh ./utilities/lint.sh
2279 by Canonical.com Patch Queue Manager
[trivial] add a make lint target (USE IT) and remove cruft
81
1746 by Canonical.com Patch Queue Manager
[r=jamesh] Simple database restoration script and sampledata fixes
82
pagetests: build
83
	env PYTHONPATH=$(PYTHONPATH) ${PYTHON} test.py test_pages
3044.1.15 by James Troup
Fix 'suspicious' line in Makefile to quiet emacs
84
1102 by Canonical.com Patch Queue Manager
Lucille had some XXXs which should have been NOTEs
85
inplace: build
86
87
build:
1831 by Canonical.com Patch Queue Manager
New config machinery, database helpers and oddsnsods required for staging
88
	${SHHH} $(MAKE) -C sourcecode build PYTHON=${PYTHON} \
89
	    PYTHON_VERSION=${PYTHON_VERSION} LPCONFIG=${LPCONFIG}
1102 by Canonical.com Patch Queue Manager
Lucille had some XXXs which should have been NOTEs
90
91
runners:
92
	echo "#!/bin/sh" > bin/runzope;
93
	echo "exec $(PYTHON) $(STARTSCRIPT) -C $(CONFFILE)" >> bin/runzope;
94
	chmod +x bin/runzope
95
	echo "#!/bin/sh" > bin/zopectl;
96
	echo "$(PYTHON) $(PWD)/src/zdaemon/zdctl.py \
97
	      -S schema.xml \
98
	      -C zdaemon.conf -d \$$*" >> bin/zopectl
99
	chmod +x bin/zopectl 
100
101
test_build: build
102
	$(PYTHON) test.py $(TESTFLAGS) $(TESTOPTS)
103
104
test_inplace: inplace
105
	$(PYTHON) test.py $(TESTFLAGS) $(TESTOPTS)
106
107
ftest_build: build
108
	env PYTHONPATH=$(PYTHONPATH) \
1746 by Canonical.com Patch Queue Manager
[r=jamesh] Simple database restoration script and sampledata fixes
109
	    $(PYTHON) test.py -f $(TESTFLAGS) $(TESTOPTS)
1102 by Canonical.com Patch Queue Manager
Lucille had some XXXs which should have been NOTEs
110
111
ftest_inplace: inplace
112
	env PYTHONPATH=$(PYTHONPATH) \
1746 by Canonical.com Patch Queue Manager
[r=jamesh] Simple database restoration script and sampledata fixes
113
	    $(PYTHON) test.py -f $(TESTFLAGS) $(TESTOPTS)
1102 by Canonical.com Patch Queue Manager
Lucille had some XXXs which should have been NOTEs
114
3691.224.2 by Stuart Bishop
Ensure branch version info is generated for both 'run' and 'start' Makefile targets
115
run: inplace stop bzr_version_info
3673.3.2 by Stuart Bishop
Remove old thread-xxx.request files on Launchpad startup
116
	rm -f thread*.request
3691.224.2 by Stuart Bishop
Ensure branch version info is generated for both 'run' and 'start' Makefile targets
117
	LPCONFIG=${LPCONFIG} PYTHONPATH=$(Z3LIBPATH):$(PYTHONPATH) \
118
		 $(PYTHON) -t $(STARTSCRIPT) -C $(CONFFILE)
119
120
bzr_version_info:
3618.1.44 by Steve Alexander
add revno to main template
121
	rm -f bzr-version-info.py bzr-version-info.pyc
122
	if which bzr > /dev/null  && test -x `which bzr`; \
3691.220.11 by James Henstridge
small change so that testbrowser works with checkboxes
123
		then PYTHONPATH= bzr version-info --format=python > bzr-version-info.py 2>/dev/null; \
124
	fi
809 by Canonical.com Patch Queue Manager
Nuke some arch-tags
125
1884 by Canonical.com Patch Queue Manager
[trivial] run-as-daemon targets
126
# Run as a daemon - hack using nohup until we move back to using zdaemon
1937 by Canonical.com Patch Queue Manager
[r=jamesh] Common PID file handing module
127
# properly. We also should really wait until services are running before 
128
# exiting, as running 'make stop' too soon after running 'make start'
129
# will not work as expected.
3691.224.2 by Stuart Bishop
Ensure branch version info is generated for both 'run' and 'start' Makefile targets
130
start: inplace stop bzr_version_info
1884 by Canonical.com Patch Queue Manager
[trivial] run-as-daemon targets
131
	LPCONFIG=${LPCONFIG} PYTHONPATH=$(Z3LIBPATH):$(PYTHONPATH) \
132
		 nohup $(PYTHON) -t $(STARTSCRIPT) -C $(CONFFILE) \
1937 by Canonical.com Patch Queue Manager
[r=jamesh] Common PID file handing module
133
		 > ${LPCONFIG}-nohup.out 2>&1 &
1884 by Canonical.com Patch Queue Manager
[trivial] run-as-daemon targets
134
1937 by Canonical.com Patch Queue Manager
[r=jamesh] Common PID file handing module
135
# Kill launchpad last - other services will probably shutdown with it,
136
# so killing them after is a race condition.
2354 by Canonical.com Patch Queue Manager
[r=bjornt] Product and Project vocabularies should not contain inactive entries. Bug#1873
137
stop: build
1937 by Canonical.com Patch Queue Manager
[r=jamesh] Common PID file handing module
138
	@ LPCONFIG=${LPCONFIG} ${PYTHON} \
3691.132.11 by David Allouche
move all hctapi and trebuchet stuff to not-used
139
	    utilities/killservice.py librarian buildsequencer launchpad
1102 by Canonical.com Patch Queue Manager
Lucille had some XXXs which should have been NOTEs
140
1716.5.37 by kiko
Add harness Makefile convenience shortcut
141
harness:
142
	PYTHONPATH=lib python -i lib/canonical/database/harness.py
143
3673.1.10 by David Allouche
add iharness target to ./Makefile, that runs ipython instead of plain python
144
iharness:
145
	PYTHONPATH=lib ipython -i lib/canonical/database/harness.py
146
1716.5.42 by kiko
Add a rebuildfti Makefile target, and make newsampledata use it
147
rebuildfti:
148
	@echo Rebuilding FTI indexes on launchpad_dev database
149
	database/schema/fti.py -d launchpad_dev --force
150
1627 by Canonical.com Patch Queue Manager
Initial, very very hacky, zcml-for-scripts support. Also, got rid of vestigal principals.zcml.
151
debug:
1831 by Canonical.com Patch Queue Manager
New config machinery, database helpers and oddsnsods required for staging
152
	LPCONFIG=${LPCONFIG} PYTHONPATH=$(Z3LIBPATH):$(PYTHONPATH) \
153
		 $(PYTHON) -i -c \ "from zope.app import Application;\
154
		    app = Application('Data.fs', 'site.zcml')()"
1102 by Canonical.com Patch Queue Manager
Lucille had some XXXs which should have been NOTEs
155
156
clean:
1716.2.29 by kiko
Make sure we /really/ clean up pygettextpo, and any libtool cruft, when make cleaning
157
	(cd sourcecode/pygettextpo; make clean)
2237 by Canonical.com Patch Queue Manager
[trivial] Libraraian upstream tweaks, which demonstrate the the feature is broken (?)
158
	find . -type f \( -name '*.o' -o -name '*.so' \
1716.2.29 by kiko
Make sure we /really/ clean up pygettextpo, and any libtool cruft, when make cleaning
159
	    -o -name '*.la' -o -name '*.lo' \
2237 by Canonical.com Patch Queue Manager
[trivial] Libraraian upstream tweaks, which demonstrate the the feature is broken (?)
160
	    -o -name '*.py[co]' -o -name '*.dll' \) -exec rm -f {} \;
1102 by Canonical.com Patch Queue Manager
Lucille had some XXXs which should have been NOTEs
161
	rm -rf build
162
163
realclean: clean
164
	rm -f TAGS tags
165
	$(PYTHON) setup.py clean -a
166
167
zcmldocs:
168
	PYTHONPATH=`pwd`/src:$(PYTHONPATH) $(PYTHON) \
2373 by Canonical.com Patch Queue Manager
[r=SteveA,BjornT] Zope3FormErrorMessages
169
	    ./sourcecode/zope/configuration/stxdocs.py \
1746 by Canonical.com Patch Queue Manager
[r=jamesh] Simple database restoration script and sampledata fixes
170
	    -f ./src/zope/app/meta.zcml -o ./doc/zcml/namespaces.zope.org
1102 by Canonical.com Patch Queue Manager
Lucille had some XXXs which should have been NOTEs
171
2237 by Canonical.com Patch Queue Manager
[trivial] Libraraian upstream tweaks, which demonstrate the the feature is broken (?)
172
potemplates: launchpad.pot
173
174
# Generate launchpad.pot by extracting message ids from the source
175
launchpad.pot:
176
	$(PYTHON) sourcecode/zope/utilities/i18nextract.py \
177
	    -d launchpad -p lib/canonical/launchpad \
178
	    -o locales
1102 by Canonical.com Patch Queue Manager
Lucille had some XXXs which should have been NOTEs
179
180
TAGS:
3618.1.39 by Steve Alexander
remove duplicate tags from make tags and TAGS targets in Makefile
181
	ctags -e -R lib
1102 by Canonical.com Patch Queue Manager
Lucille had some XXXs which should have been NOTEs
182
183
tags:
3618.1.39 by Steve Alexander
remove duplicate tags from make tags and TAGS targets in Makefile
184
	ctags -R lib
1102 by Canonical.com Patch Queue Manager
Lucille had some XXXs which should have been NOTEs
185
1716.1.49 by Christian Reis
Removing cruft from the main Makefile
186
.PHONY: check tags TAGS zcmldocs realclean clean debug stop start run \
187
		ftest_build ftest_inplace test_build test_inplace pagetests \
3504.1.55 by kiko
Implement half of https://launchpad.net/products/launchpad/+spec/stop-spurious-test-failures by adding a special Makefile target that doesn't run some of the sourcecode tets.
188
		check importdcheck check_merge schema default launchpad.pot \
189
		check_launchpad_on_merge hctcheck
1102 by Canonical.com Patch Queue Manager
Lucille had some XXXs which should have been NOTEs
190