-ARCH:=$(strip $(subst ",, $(CONFIG_ARCH)))
-TARGET_OPTIMIZATION:=$(strip $(subst ",, $(CONFIG_TARGET_OPTIMIZATION)))
-BUILD_DIR_SUFFIX:=$(strip $(subst ",, $(CONFIG_BUILD_SUFFIX)))
-WGET:=$(strip $(subst ",, $(CONFIG_WGET)))
-#"))"))")) # fix vim's broken syntax highlighting
+define qstrip
+$(strip $(subst ",,$(1)))
+endef
+#"))
+
+ARCH:=$(call qstrip,$(CONFIG_ARCH))
+BOARD:=$(call qstrip,$(CONFIG_TARGET_BOARD))
+TARGET_OPTIMIZATION:=$(call qstrip,$(CONFIG_TARGET_OPTIMIZATION))
+BUILD_SUFFIX:=$(call qstrip,$(CONFIG_BUILD_SUFFIX))
+GCCV:=$(call qstrip,$(CONFIG_GCC_VERSION))
+SUBDIR:=$(patsubst $(TOPDIR)/%,%,${CURDIR})