-# Uncomment this to turn on verbose mode.
-#export DH_VERBOSE=1
-
-# You can use gcc 2.7.2 if it's installed,
-# but I don't think that's necessary any more.
-#SETGCC := CC=$(notdir $(shell which gcc272 gcc 2>/dev/null | sed '1q'))
+# Parsing of DEB_BUILD_OPTIONS flags.
+# Note that nostrip is handled automatically by debhelper.
+CFLAGS := -g -Wall
+ifneq (,$(filter noopt,$(DEB_BUILD_OPTIONS)))
+ CFLAGS += -O0
+else
+ CFLAGS += -O2
+endif
+ifneq (,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
+ NUMJOBS = $(patsubst parallel=%,%,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
+ MAKEFLAGS += -j$(NUMJOBS)
+endif