X-Git-Url: http://git.openwrt.org/?p=openwrt%2Fopenwrt.git;a=blobdiff_plain;f=rules.mk;h=b5be5b267184d16b8fc4a5fd585151ac8ed488f9;hp=f749863d7cb8acc5d5899ea127bee8a5499e54cf;hb=7a3dacef988ffc619d4a1faed80d05177980c498;hpb=940bc81bc2dee35f01c7ca6e5e588f62a20b82f8 diff --git a/rules.mk b/rules.mk index f749863d7c..b5be5b2671 100644 --- a/rules.mk +++ b/rules.mk @@ -26,6 +26,11 @@ merge=$(subst $(space),,$(1)) confvar=$(call merge,$(foreach v,$(1),$(if $($(v)),y,n))) strip_last=$(patsubst %.$(lastword $(subst .,$(space),$(1))),%,$(1)) +paren_left = ( +paren_right = ) +chars_lower = a b c d e f g h i j k l m n o p q r s t u v w x y z +chars_upper = A B C D E F G H I J K L M N O P Q R S T U V W X Y Z + define sep endef @@ -35,6 +40,15 @@ define newline endef +__tr_list = $(join $(join $(1),$(foreach char,$(1),$(comma))),$(2)) +__tr_head_stripped = $(subst $(space),,$(foreach cv,$(call __tr_list,$(1),$(2)),$$$(paren_left)subst$(cv)$(comma))) +__tr_head = $(subst $(paren_left)subst,$(paren_left)subst$(space),$(__tr_head_stripped)) +__tr_tail = $(subst $(space),,$(foreach cv,$(1),$(paren_right))) +__tr_template = $(__tr_head)$$(1)$(__tr_tail) + +$(eval toupper = $(call __tr_template,$(chars_lower),$(chars_upper))) +$(eval tolower = $(call __tr_template,$(chars_upper),$(chars_lower))) + _SINGLE=export MAKEFLAGS=$(space); CFLAGS:= ARCH:=$(subst i486,i386,$(subst i586,i386,$(subst i686,i386,$(call qstrip,$(CONFIG_ARCH))))) @@ -201,7 +215,7 @@ HOST_CPPFLAGS:=-I$(STAGING_DIR_HOST)/include -I$(STAGING_DIR_HOST)/usr/include HOST_CFLAGS:=-O2 $(HOST_CPPFLAGS) HOST_LDFLAGS:=-L$(STAGING_DIR_HOST)/lib -L$(STAGING_DIR_HOST)/usr/lib -ifeq ($(CONFIG_GCC_VERSION_4_6)$(CONFIG_EXTERNAL_TOOLCHAIN),) +ifeq ($(CONFIG_EXTERNAL_TOOLCHAIN),) TARGET_AR:=$(TARGET_CROSS)gcc-ar TARGET_RANLIB:=$(TARGET_CROSS)gcc-ranlib TARGET_NM:=$(TARGET_CROSS)gcc-nm