rules.mk: make toolchain dirs define more consistent
Make toolchain dirs define more consistent between internal and external toolchains. Make use of specific dirs also for intenral toolchain and generilize include and lib inclusion. Also set TOOLCHAIN_ROOT_DIR for internal toolchain as this is what packages should use to reference staging toolchain directory. Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
This commit is contained in:
parent
28420cd67b
commit
987458c2e1
1 changed files with 14 additions and 14 deletions
14
rules.mk
14
rules.mk
|
@ -184,14 +184,14 @@ ifndef DUMP
|
||||||
-include $(TOOLCHAIN_DIR)/info.mk
|
-include $(TOOLCHAIN_DIR)/info.mk
|
||||||
export GCC_HONOUR_COPTS:=0
|
export GCC_HONOUR_COPTS:=0
|
||||||
TARGET_CROSS:=$(if $(TARGET_CROSS),$(TARGET_CROSS),$(OPTIMIZE_FOR_CPU)-openwrt-linux$(if $(TARGET_SUFFIX),-$(TARGET_SUFFIX))-)
|
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_CFLAGS+= -fhonour-copts
|
||||||
TARGET_CPPFLAGS+= -I$(TOOLCHAIN_DIR)/usr/include
|
|
||||||
ifeq ($(CONFIG_USE_MUSL),y)
|
ifeq ($(CONFIG_USE_MUSL),y)
|
||||||
TARGET_CPPFLAGS+= -I$(TOOLCHAIN_DIR)/include/fortify
|
TOOLCHAIN_INC_DIRS+= $(TOOLCHAIN_DIR)/include/fortify
|
||||||
endif
|
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
|
else
|
||||||
ifeq ($(CONFIG_NATIVE_TOOLCHAIN),)
|
ifeq ($(CONFIG_NATIVE_TOOLCHAIN),)
|
||||||
TARGET_CROSS:=$(call qstrip,$(CONFIG_TOOLCHAIN_PREFIX))
|
TARGET_CROSS:=$(call qstrip,$(CONFIG_TOOLCHAIN_PREFIX))
|
||||||
|
@ -199,6 +199,8 @@ ifndef DUMP
|
||||||
TOOLCHAIN_BIN_DIRS:=$(patsubst ./%,$(TOOLCHAIN_ROOT_DIR)/%,$(call qstrip,$(CONFIG_TOOLCHAIN_BIN_PATH)))
|
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_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)))
|
TOOLCHAIN_LIB_DIRS:=$(patsubst ./%,$(TOOLCHAIN_ROOT_DIR)/%,$(call qstrip,$(CONFIG_TOOLCHAIN_LIB_PATH)))
|
||||||
|
endif
|
||||||
|
endif
|
||||||
ifneq ($(TOOLCHAIN_BIN_DIRS),)
|
ifneq ($(TOOLCHAIN_BIN_DIRS),)
|
||||||
TARGET_PATH:=$(subst $(space),:,$(TOOLCHAIN_BIN_DIRS)):$(TARGET_PATH)
|
TARGET_PATH:=$(subst $(space),:,$(TOOLCHAIN_BIN_DIRS)):$(TARGET_PATH)
|
||||||
endif
|
endif
|
||||||
|
@ -209,8 +211,6 @@ ifndef DUMP
|
||||||
TARGET_LDFLAGS+= $(patsubst %,-L%,$(TOOLCHAIN_LIB_DIRS))
|
TARGET_LDFLAGS+= $(patsubst %,-L%,$(TOOLCHAIN_LIB_DIRS))
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
endif
|
|
||||||
endif
|
|
||||||
|
|
||||||
TARGET_LINKER?=bfd
|
TARGET_LINKER?=bfd
|
||||||
TARGET_LDFLAGS+= -fuse-ld=$(TARGET_LINKER)
|
TARGET_LDFLAGS+= -fuse-ld=$(TARGET_LINKER)
|
||||||
|
|
Loading…
Reference in a new issue