~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}
1102 by Canonical.com Patch Queue Manager
Lucille had some XXXs which should have been NOTEs
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
47
hctcheck: build
3587.2.5 by Andrew Bennetts
Re-enable sourcecode/* and hct and sourcerer checks.
48
	env PYTHONPATH=$(PYTHONPATH) \
49
	    ${PYTHON} -t ./test_on_merge.py -vv \
50
	        --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
51
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.
52
importdcheck: build
53
	env PYTHONPATH=$(PYTHONPATH) \
3691.123.1 by David Allouche
use series id instead of arch name in name of importd working dir
54
	${PYTHON} -t ./lib/importd/test_all.py "$$TESTFILTER"
1810 by Canonical.com Patch Queue Manager
move importd code from buildbots tree to launchpad
55
63.1.94 by Robert Collins
enable cscvs and related test suites again
56
check: build
1102 by Canonical.com Patch Queue Manager
Lucille had some XXXs which should have been NOTEs
57
	# 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
58
	# database..
1377 by Canonical.com Patch Queue Manager
fix makefile setting of PYTHONPATH
59
	env PYTHONPATH=$(PYTHONPATH) \
2976.10.107 by Stuart Bishop
Merge from Rocketfuel
60
	${PYTHON} -t ./test_on_merge.py -vv
1102 by Canonical.com Patch Queue Manager
Lucille had some XXXs which should have been NOTEs
61
2279 by Canonical.com Patch Queue Manager
[trivial] add a make lint target (USE IT) and remove cruft
62
lint:
2513 by Canonical.com Patch Queue Manager
[trivial] Implement make lintmerge.
63
	@sh ./utilities/lint.sh
64
2976.10.108 by Stuart Bishop
Fix poexport-distrorelease-date-tarball test by including log output
65
#lintmerge:
66
#	@# Thank Stuart, not me!
67
#	@baz diff -s rocketfuel@canonical.com/launchpad--devel--0 | \
68
#		grep -v "^*" | \
69
#		grep -v "{arch}" | \
70
#		cut -c4- | \
71
#		xargs sh ./utilities/lint.sh
2279 by Canonical.com Patch Queue Manager
[trivial] add a make lint target (USE IT) and remove cruft
72
1746 by Canonical.com Patch Queue Manager
[r=jamesh] Simple database restoration script and sampledata fixes
73
pagetests: build
74
	env PYTHONPATH=$(PYTHONPATH) ${PYTHON} test.py test_pages
3044.1.15 by James Troup
Fix 'suspicious' line in Makefile to quiet emacs
75
1102 by Canonical.com Patch Queue Manager
Lucille had some XXXs which should have been NOTEs
76
inplace: build
77
78
build:
1831 by Canonical.com Patch Queue Manager
New config machinery, database helpers and oddsnsods required for staging
79
	${SHHH} $(MAKE) -C sourcecode build PYTHON=${PYTHON} \
80
	    PYTHON_VERSION=${PYTHON_VERSION} LPCONFIG=${LPCONFIG}
1102 by Canonical.com Patch Queue Manager
Lucille had some XXXs which should have been NOTEs
81
82
runners:
83
	echo "#!/bin/sh" > bin/runzope;
84
	echo "exec $(PYTHON) $(STARTSCRIPT) -C $(CONFFILE)" >> bin/runzope;
85
	chmod +x bin/runzope
86
	echo "#!/bin/sh" > bin/zopectl;
87
	echo "$(PYTHON) $(PWD)/src/zdaemon/zdctl.py \
88
	      -S schema.xml \
89
	      -C zdaemon.conf -d \$$*" >> bin/zopectl
90
	chmod +x bin/zopectl 
91
92
test_build: build
93
	$(PYTHON) test.py $(TESTFLAGS) $(TESTOPTS)
94
95
test_inplace: inplace
96
	$(PYTHON) test.py $(TESTFLAGS) $(TESTOPTS)
97
98
ftest_build: build
99
	env PYTHONPATH=$(PYTHONPATH) \
1746 by Canonical.com Patch Queue Manager
[r=jamesh] Simple database restoration script and sampledata fixes
100
	    $(PYTHON) test.py -f $(TESTFLAGS) $(TESTOPTS)
1102 by Canonical.com Patch Queue Manager
Lucille had some XXXs which should have been NOTEs
101
102
ftest_inplace: inplace
103
	env PYTHONPATH=$(PYTHONPATH) \
1746 by Canonical.com Patch Queue Manager
[r=jamesh] Simple database restoration script and sampledata fixes
104
	    $(PYTHON) test.py -f $(TESTFLAGS) $(TESTOPTS)
1102 by Canonical.com Patch Queue Manager
Lucille had some XXXs which should have been NOTEs
105
1939 by Canonical.com Patch Queue Manager
[trivial] Fix busted Makefile
106
run: inplace stop
3673.3.2 by Stuart Bishop
Remove old thread-xxx.request files on Launchpad startup
107
	rm -f thread*.request
1831 by Canonical.com Patch Queue Manager
New config machinery, database helpers and oddsnsods required for staging
108
	LPCONFIG=${LPCONFIG} PYTHONPATH=$(Z3LIBPATH):$(PYTHONPATH) \
1813 by Canonical.com Patch Queue Manager
[trivial] Specify config section using LPCONFIG
109
		 $(PYTHON) -t $(STARTSCRIPT) -C $(CONFFILE)
809 by Canonical.com Patch Queue Manager
Nuke some arch-tags
110
1884 by Canonical.com Patch Queue Manager
[trivial] run-as-daemon targets
111
# 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
112
# properly. We also should really wait until services are running before 
113
# exiting, as running 'make stop' too soon after running 'make start'
114
# will not work as expected.
115
start: inplace stop
1884 by Canonical.com Patch Queue Manager
[trivial] run-as-daemon targets
116
	LPCONFIG=${LPCONFIG} PYTHONPATH=$(Z3LIBPATH):$(PYTHONPATH) \
117
		 nohup $(PYTHON) -t $(STARTSCRIPT) -C $(CONFFILE) \
1937 by Canonical.com Patch Queue Manager
[r=jamesh] Common PID file handing module
118
		 > ${LPCONFIG}-nohup.out 2>&1 &
1884 by Canonical.com Patch Queue Manager
[trivial] run-as-daemon targets
119
1937 by Canonical.com Patch Queue Manager
[r=jamesh] Common PID file handing module
120
# Kill launchpad last - other services will probably shutdown with it,
121
# 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
122
stop: build
1937 by Canonical.com Patch Queue Manager
[r=jamesh] Common PID file handing module
123
	@ LPCONFIG=${LPCONFIG} ${PYTHON} \
2603 by Canonical.com Patch Queue Manager
Build daemon task sequencer/serialiser. r=spiv
124
	    utilities/killservice.py librarian trebuchet \
125
                                     buildsequencer launchpad
1102 by Canonical.com Patch Queue Manager
Lucille had some XXXs which should have been NOTEs
126
1716.5.37 by kiko
Add harness Makefile convenience shortcut
127
harness:
128
	PYTHONPATH=lib python -i lib/canonical/database/harness.py
129
1716.5.42 by kiko
Add a rebuildfti Makefile target, and make newsampledata use it
130
rebuildfti:
131
	@echo Rebuilding FTI indexes on launchpad_dev database
132
	database/schema/fti.py -d launchpad_dev --force
133
1627 by Canonical.com Patch Queue Manager
Initial, very very hacky, zcml-for-scripts support. Also, got rid of vestigal principals.zcml.
134
debug:
1831 by Canonical.com Patch Queue Manager
New config machinery, database helpers and oddsnsods required for staging
135
	LPCONFIG=${LPCONFIG} PYTHONPATH=$(Z3LIBPATH):$(PYTHONPATH) \
136
		 $(PYTHON) -i -c \ "from zope.app import Application;\
137
		    app = Application('Data.fs', 'site.zcml')()"
1102 by Canonical.com Patch Queue Manager
Lucille had some XXXs which should have been NOTEs
138
139
clean:
1716.2.29 by kiko
Make sure we /really/ clean up pygettextpo, and any libtool cruft, when make cleaning
140
	(cd sourcecode/pygettextpo; make clean)
2237 by Canonical.com Patch Queue Manager
[trivial] Libraraian upstream tweaks, which demonstrate the the feature is broken (?)
141
	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
142
	    -o -name '*.la' -o -name '*.lo' \
2237 by Canonical.com Patch Queue Manager
[trivial] Libraraian upstream tweaks, which demonstrate the the feature is broken (?)
143
	    -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
144
	rm -rf build
145
146
realclean: clean
147
	rm -f TAGS tags
148
	$(PYTHON) setup.py clean -a
149
150
zcmldocs:
151
	PYTHONPATH=`pwd`/src:$(PYTHONPATH) $(PYTHON) \
2373 by Canonical.com Patch Queue Manager
[r=SteveA,BjornT] Zope3FormErrorMessages
152
	    ./sourcecode/zope/configuration/stxdocs.py \
1746 by Canonical.com Patch Queue Manager
[r=jamesh] Simple database restoration script and sampledata fixes
153
	    -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
154
2237 by Canonical.com Patch Queue Manager
[trivial] Libraraian upstream tweaks, which demonstrate the the feature is broken (?)
155
potemplates: launchpad.pot
156
157
# Generate launchpad.pot by extracting message ids from the source
158
launchpad.pot:
159
	$(PYTHON) sourcecode/zope/utilities/i18nextract.py \
160
	    -d launchpad -p lib/canonical/launchpad \
161
	    -o locales
1102 by Canonical.com Patch Queue Manager
Lucille had some XXXs which should have been NOTEs
162
163
TAGS:
3044.1.14 by James Troup
Use ctags to create emacs TAGS file.
164
	ctags -e -R lib sourcecode
1102 by Canonical.com Patch Queue Manager
Lucille had some XXXs which should have been NOTEs
165
166
tags:
2779.2.1 by Stuart Bishop
Refactor exception handling so that no database queries need to be made to determine if exceptions should be displayed to the user or not
167
	ctags -R lib sourcecode
1102 by Canonical.com Patch Queue Manager
Lucille had some XXXs which should have been NOTEs
168
1716.1.49 by Christian Reis
Removing cruft from the main Makefile
169
.PHONY: check tags TAGS zcmldocs realclean clean debug stop start run \
170
		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.
171
		check importdcheck check_merge schema default launchpad.pot \
172
		check_launchpad_on_merge hctcheck
1102 by Canonical.com Patch Queue Manager
Lucille had some XXXs which should have been NOTEs
173