--- unstableorigs/binutils-2.23.1/debian/rules	2012-12-10 15:43:53.000000000 +0000
+++ unstablenew/binutils-2.23.1/debian/rules	2012-12-10 15:39:53.000000000 +0000
@@ -53,21 +53,29 @@
 DEB_HOST_GNU_TYPE	?= $(call vafilt,$(DPKG_VARS),DEB_HOST_GNU_TYPE)
 DEB_HOST_MULTIARCH	?= $(call vafilt,$(DPKG_VARS),DEB_HOST_MULTIARCH)
 
-# If $(TARGET) is not set, try reading debian/target
-ifeq (,$(TARGET))
+#---------------------------------------------------------------------------
+# set target
+# - Debian arch or GNU triplet via DEB_TARGET_ARCH
+# - Debian arch or GNU triplet via deprecated TARGET
+# - Debian arch or GNU triplet in debian/target
+
+#Support the old TARGET variable whilst it's still used
+DEB_TARGET_ARCH ?= $(TARGET)
+
+ifeq (,$(DEB_TARGET_ARCH))
   ifneq (,$(wildcard debian/target))
-    TARGET := $(shell cat debian/target 2>/dev/null)
+    DEB_TARGET_ARCH := $(shell cat debian/target 2>/dev/null)
   endif
 endif
 
-ifneq (,$(TARGET))
-  # Support TARGET both as Debian architecture specification (e.g. arm),
+ifneq (,$(DEB_TARGET_ARCH))
+  # Support DEB_TARGET_ARCH both as Debian architecture specification (e.g. arm),
   # and as the target name (e.g. arm-linux-gnu).
-  try_convert := $(shell dpkg-architecture -f -a$(TARGET) -qDEB_HOST_GNU_TYPE 2>/dev/null)
+  try_convert := $(shell dpkg-architecture -f -t$(DEB_TARGET_ARCH) -qDEB_HOST_ARCH 2>/dev/null)
   ifneq ($(try_convert),)
-    override TARGET := $(try_convert)
+    override DEB_TARGET_ARCH := $(try_convert)
   endif
-  DPKG_TARGET_VARS := $(shell dpkg-architecture -f -t$(TARGET))
+  DPKG_TARGET_VARS := $(shell dpkg-architecture -f -a$(DEB_TARGET_ARCH))
   DEB_TARGET_MULTIARCH = $(call vafilt,$(DPKG_TARGET_VARS),DEB_HOST_MULTIARCH)
   DEB_TARGET_ARCH      = $(call vafilt,$(DPKG_TARGET_VARS),DEB_HOST_ARCH)
 else
@@ -75,6 +83,11 @@
   DEB_TARGET_ARCH      = $(DEB_HOST_ARCH)
 endif
 
+ifeq ($(DEB_TARGET_ARCH),)
+  $(error Invalid architecure.)
+endif
+
+
 ifeq (,$(DEB_HOST_MULTIARCH))
   ifeq ($(DEB_HOST_ARCH),i386)
     DEB_HOST_MULTIARCH = i386-linux-gnu
