~usb-creator-hackers/usb-creator/trunk

97.2.24 by Evan Dandrea
Support for building a Windows executable. Run make build_windows or make test_windows.
1
WINE = WINEPREFIX=$(PWD)/wine wine
2
WINEPY = $(WINE) C:\\Python26\\python.exe
3
RVER = `head -n1 debian/changelog | sed 's,.*(\(.*\)).*,\1,'`
97.2.44 by Evan Dandrea
Add the bzr revision number to the resulting Windows binary.
4
REV = `bzr revno`
97.2.46 by Evan Dandrea
Very small fix to the name of the resulting Windows binary.
5
RESULT="build/usb-creator-r$(REV)-$(RVER).exe"
97.2.24 by Evan Dandrea
Support for building a Windows executable. Run make build_windows or make test_windows.
6
56 by Evan Dandrea
* i18n support (LP: #285413, #292556).
7
update-po:
170.1.1 by Evan Dandrea
Initial commit of PolicyKit support.
8
	find -regex "./\(usbcreator\|dbus\|gui\|desktop\).*\.\(py\|glade\|ui\|in\)" \
173 by Roderick B. Greening
* Only the gtk ui is glade... fix sed to deal with that
9
		| sed '/gtk\.ui/ s,^,[type: gettext/glade],' > po/POTFILES.in
175 by Roderick B. Greening
* Update Makefile for consistancy (trivial change)
10
	echo ./main.py >> po/POTFILES.in
171 by Roderick B. Greening
* Fix Makefile to include ./bin/usb-creator-* for translations
11
	echo ./bin/usb-creator-gtk >> po/POTFILES.in
12
	echo ./bin/usb-creator-kde >> po/POTFILES.in
56 by Evan Dandrea
* i18n support (LP: #285413, #292556).
13
	python setup.py build_i18n --merge-po --po-dir po
97.2.12 by Evan Dandrea
Added a test harness for the Windows backend.
14
97.2.24 by Evan Dandrea
Support for building a Windows executable. Run make build_windows or make test_windows.
15
check_external_deps:
16
	tools/check_external_deps
17
18
check_windows: check_external_deps
19
	$(WINEPY) ./tests/run-win
20
21
check: check_windows
97.2.12 by Evan Dandrea
Added a test harness for the Windows backend.
22
	tests/run
97.2.24 by Evan Dandrea
Support for building a Windows executable. Run make build_windows or make test_windows.
23
97.2.40 by Evan Dandrea
* Add working (untested outside of WINE) i18n support to the Windows frontend.
24
build_windows: build_pylauncher translations
97.2.31 by Evan Dandrea
Pull 7z.exe from the temporary wine directory to include in the build.
25
	cp wine/drive_c/Program\ Files/7-Zip/7z.exe build
97.2.40 by Evan Dandrea
* Add working (untested outside of WINE) i18n support to the Windows frontend.
26
	$(WINEPY) -OO tools/pypack/pypack --verbose --bytecompile --outputdir=build/usbcreator main.py tools/_include.py tools/dd.exe tools/syslinux.exe build/7z.exe build/translations
97.2.24 by Evan Dandrea
Support for building a Windows executable. Run make build_windows or make test_windows.
27
	$(WINEPY) -OO build/pylauncher/pack.py build/usbcreator
97.2.44 by Evan Dandrea
Add the bzr revision number to the resulting Windows binary.
28
	mv build/application.exe $(RESULT)
29
	du -h $(RESULT)
97.2.24 by Evan Dandrea
Support for building a Windows executable. Run make build_windows or make test_windows.
30
31
build_pylauncher: clean check_external_deps
32
	cp -r tools/pylauncher build
33
	cp wine/drive_c/windows/system32/python26.dll build/pylauncher
97.2.26 by Evan Dandrea
* Added a Windows icon to be displayed as the application icon on the desktop.
34
	cp desktop/usb-creator.ico build/pylauncher/application.ico
97.2.24 by Evan Dandrea
Support for building a Windows executable. Run make build_windows or make test_windows.
35
	cd build/pylauncher; $(MAKE)
36
37
test_windows: build_windows
97.2.44 by Evan Dandrea
Add the bzr revision number to the resulting Windows binary.
38
	$(WINE) $(RESULT)
97.2.24 by Evan Dandrea
Support for building a Windows executable. Run make build_windows or make test_windows.
39
40
clean:
41
	rm -rf build/*
42
	cd tools/pylauncher; $(MAKE) clean
97.2.37 by Evan Dandrea
* Handle unhandled exceptions by displaying an error message and exiting.
43
	find tools/pypack -type f -name "*.pyo" -delete
97.2.40 by Evan Dandrea
* Add working (untested outside of WINE) i18n support to the Windows frontend.
44
45
translations: po/*.po
46
	# TODO evand 2009-07-28: Ideally we should build the mo files once,
47
	# instead of once here and once in setup.py.
48
	# Taken from Wubi.
49
	rm -rf build/translations
50
	mkdir -p build/translations/
51
	@for po in $^; do \
52
		language=`basename $$po`; \
53
		language=$${language%%.po}; \
54
		target="build/translations/$$language/LC_MESSAGES"; \
55
		mkdir -p $$target; \
56
		msgfmt --output=$$target/usbcreator.mo $$po; \
57
	done