diff --git a/Makefile b/Makefile
index de026a97bb4d3e53a64e34781bd8fa93bf051adb..4f9a2e4463d03338c534a78895861a73d35f7a39 100644
--- a/Makefile
+++ b/Makefile
@@ -4,17 +4,19 @@ MODULES		= common plugins/gtkgui
 PREFIX		= /usr
 DESTDIR		= /
 
-FIND		= find -regex '.*\.\(\(glade\)\|\(py\)\|\(xpm\)\|\(gif\)\|\(png\)\|\(mo\)\|\(wav\)\)'
+FIND		= find -regex '.*\.\(\(glade\)\|\(pyo\)\|\(xpm\)\|\(gif\)\|\(png\)\|\(mo\)\|\(wav\)\)'
 FILES		= `$(FIND)`
 DIRS		= `$(FIND) -exec dirname {} \; | sort -u`
 FIND_LIB	= find -regex '.*\.\(so\)'
 FILES_LIB	= `$(FIND_LIB)`
+FIND_PY		= find -regex '.*\.\(py\)'
+FILES_PY	= `$(FIND_PY)`
 
 LANGS		= fr pt_BR
 SCRIPTS = \
 	scripts/gajim
 
-all: translation trayicon idle
+all: translation trayicon idle pyo
 
 translation:
 	for l in $(LANGS) ; do \
@@ -27,6 +29,12 @@ trayicon:
 idle:
 	make -C common all;
 
+pyo:
+	ST="import py_compile\n py_compile.compile('$$f')"
+	for f in $(FILES_PY) ; do \
+		python -O -c "$$ST"; \
+	done
+
 clean:
 	find -name *.pyc -exec rm {} \;
 	find -name *.mo -exec rm {} \;