X-Git-Url: http://git.openwrt.org/?a=blobdiff_plain;f=rules.mk;h=6f05047f26d92907895f8de43ed3ab1c8ec5ee69;hb=HEAD;hp=1cedd91aa8df23d7b0cf35ccae57dc7f82a8b2b1;hpb=21ab20bc64f5608d9341b1878fa1c5a569b471d5;p=openwrt%2Fstaging%2Fhauke.git diff --git a/rules.mk b/rules.mk index 1cedd91aa8..6f05047f26 100644 --- a/rules.mk +++ b/rules.mk @@ -184,14 +184,14 @@ ifndef DUMP -include $(TOOLCHAIN_DIR)/info.mk export GCC_HONOUR_COPTS:=0 TARGET_CROSS:=$(if $(TARGET_CROSS),$(TARGET_CROSS),$(OPTIMIZE_FOR_CPU)-openwrt-linux$(if $(TARGET_SUFFIX),-$(TARGET_SUFFIX))-) + TOOLCHAIN_ROOT_DIR:=$(TOPDIR)/staging_dir/$(TOOLCHAIN_DIR_NAME) + TOOLCHAIN_BIN_DIRS:=$(TOOLCHAIN_ROOT_DIR)/bin + TOOLCHAIN_INC_DIRS:=$(TOOLCHAIN_ROOT_DIR)/usr/include $(TOOLCHAIN_ROOT_DIR)/include + TOOLCHAIN_LIB_DIRS:=$(TOOLCHAIN_ROOT_DIR)/usr/lib $(TOOLCHAIN_ROOT_DIR)/lib TARGET_CFLAGS+= -fhonour-copts - TARGET_CPPFLAGS+= -I$(TOOLCHAIN_DIR)/usr/include ifeq ($(CONFIG_USE_MUSL),y) - TARGET_CPPFLAGS+= -I$(TOOLCHAIN_DIR)/include/fortify + TOOLCHAIN_INC_DIRS+= $(TOOLCHAIN_DIR)/include/fortify endif - TARGET_CPPFLAGS+= -I$(TOOLCHAIN_DIR)/include - TARGET_LDFLAGS+= -L$(TOOLCHAIN_DIR)/usr/lib -L$(TOOLCHAIN_DIR)/lib - TARGET_PATH:=$(TOOLCHAIN_DIR)/bin:$(TARGET_PATH) else ifeq ($(CONFIG_NATIVE_TOOLCHAIN),) TARGET_CROSS:=$(call qstrip,$(CONFIG_TOOLCHAIN_PREFIX)) @@ -199,17 +199,17 @@ ifndef DUMP TOOLCHAIN_BIN_DIRS:=$(patsubst ./%,$(TOOLCHAIN_ROOT_DIR)/%,$(call qstrip,$(CONFIG_TOOLCHAIN_BIN_PATH))) TOOLCHAIN_INC_DIRS:=$(patsubst ./%,$(TOOLCHAIN_ROOT_DIR)/%,$(call qstrip,$(CONFIG_TOOLCHAIN_INC_PATH))) TOOLCHAIN_LIB_DIRS:=$(patsubst ./%,$(TOOLCHAIN_ROOT_DIR)/%,$(call qstrip,$(CONFIG_TOOLCHAIN_LIB_PATH))) - ifneq ($(TOOLCHAIN_BIN_DIRS),) - TARGET_PATH:=$(subst $(space),:,$(TOOLCHAIN_BIN_DIRS)):$(TARGET_PATH) - endif - ifneq ($(TOOLCHAIN_INC_DIRS),) - TARGET_CPPFLAGS+= $(patsubst %,-I%,$(TOOLCHAIN_INC_DIRS)) - endif - ifneq ($(TOOLCHAIN_LIB_DIRS),) - TARGET_LDFLAGS+= $(patsubst %,-L%,$(TOOLCHAIN_LIB_DIRS)) - endif endif endif + ifneq ($(TOOLCHAIN_BIN_DIRS),) + TARGET_PATH:=$(subst $(space),:,$(TOOLCHAIN_BIN_DIRS)):$(TARGET_PATH) + endif + ifneq ($(TOOLCHAIN_INC_DIRS),) + TARGET_CPPFLAGS+= $(patsubst %,-I%,$(TOOLCHAIN_INC_DIRS)) + endif + ifneq ($(TOOLCHAIN_LIB_DIRS),) + TARGET_LDFLAGS+= $(patsubst %,-L%,$(TOOLCHAIN_LIB_DIRS)) + endif endif TARGET_LINKER?=bfd @@ -240,8 +240,8 @@ PKG_CONFIG:=$(STAGING_DIR_HOST)/bin/pkg-config export PKG_CONFIG -HOSTCC:=gcc -HOSTCXX:=g++ +HOSTCC:=$(STAGING_DIR_HOST)/bin/gcc +HOSTCXX:=$(STAGING_DIR_HOST)/bin/g++ HOST_CPPFLAGS:=-I$(STAGING_DIR_HOST)/include $(if $(IS_PACKAGE_BUILD),-I$(STAGING_DIR_HOSTPKG)/include -I$(STAGING_DIR)/host/include) HOST_CXXFLAGS:= HOST_CFLAGS:=-O2 $(HOST_CPPFLAGS) @@ -330,7 +330,7 @@ else STRIP:=$(TARGET_CROSS)strip $(call qstrip,$(CONFIG_STRIP_ARGS)) else ifneq ($(CONFIG_USE_SSTRIP),) - STRIP:=$(STAGING_DIR_HOST)/bin/sstrip $(call qstrip,$(CONFIG_SSTRIP_ARGS)) + STRIP:=$(STAGING_DIR_HOST)/bin/sstrip $(if $(CONFIG_SSTRIP_DISCARD_TRAILING_ZEROES),-z) endif endif RSTRIP= \