--- rules.orig	2013-07-23 15:15:56.000000000 +0800
+++ rules	2013-09-17 23:54:25.243910126 +0800
@@ -42,6 +42,10 @@
 export DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
 export DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)
 
+ifneq (,$(filter parallel=%,$(subst $(COMMA), ,$(DEB_BUILD_OPTIONS))))
+	NJOBS := -j $(subst parallel=,,$(filter parallel=%,$(subst $(COMMA), ,$(DEB_BUILD_OPTIONS))))
+endif
+
 ifeq ($(DEB_BUILD_GNU_TYPE), $(DEB_HOST_GNU_TYPE))
 	confflags += --build $(DEB_HOST_GNU_TYPE)
 else
@@ -159,7 +163,7 @@
 	echo Starting build-super-server
 	dh_testdir
 	[ -d $(FIREBIRD_TMP) ] || mkdir $(FIREBIRD_TMP)
-	$(shell dpkg-buildflags --export=sh); $(MAKE)
+	$(shell dpkg-buildflags --export=sh); $(MAKE) $(NJOBS)
 
 	# moving to SuperServer target
 	rm -rf ./debian/firebird-super
@@ -174,7 +178,7 @@
 	echo Starting build-classic-server
 	dh_testdir
 	[ -d $(FIREBIRD_TMP) ] || mkdir $(FIREBIRD_TMP)
-	$(shell dpkg-buildflags --export=sh); $(MAKE)
+	$(shell dpkg-buildflags --export=sh); $(MAKE) $(NJOBS)
 
 	# moving to ClassicServer target
 	rm -rf ./debian/firebird-classic
