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

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
WINE = WINEPREFIX=$(PWD)/wine wine
WINEPY = $(WINE) C:\\Python26\\python.exe
RVER = `head -n1 debian/changelog | sed 's,.*(\(.*\)).*,\1,'`

update-po:
	find -regex "./\(usbcreator\|scripts\|gui\).*\.\(py\|glade\|ui\)" > po/POTFILES.in
	echo ./desktop/usb-creator-gtk.desktop.in >> po/POTFILES.in
	echo ./desktop/usb-creator-kde.desktop.in >> po/POTFILES.in
	python setup.py build_i18n --merge-po --po-dir po

check_external_deps:
	tools/check_external_deps

check_windows: check_external_deps
	$(WINEPY) ./tests/run-win

check: check_windows
	tests/run

build_windows: build_pylauncher
	$(WINEPY) -OO tools/pypack/pypack --verbose --bytecompile --outputdir=build/usbcreator main.py tools/_include.py
	$(WINEPY) -OO build/pylauncher/pack.py build/usbcreator
	mv build/application.exe build/usb-creator-$(RVER).exe

build_pylauncher: clean check_external_deps
	cp -r tools/pylauncher build
	cp wine/drive_c/windows/system32/python26.dll build/pylauncher
	cd build/pylauncher; $(MAKE)

test_windows: build_windows
	$(WINE) build/usb-creator-$(RVER).exe

clean:
	rm -rf build/*
	cd tools/pylauncher; $(MAKE) clean
	find tools/pypack -type f -name "*.pyo" -exec rm -f {} \;