X-Git-Url: http://git.rohieb.name/openwrt.git/blobdiff_plain/fe3cc5d51cb7215f6a7bb7a90c09e5ee7282564a..e861730fef124e281a02fdff38511bfbbb8fae99:/rules.mk diff --git a/rules.mk b/rules.mk index 536f8cff7..a7d7a34d5 100644 --- a/rules.mk +++ b/rules.mk @@ -1,5 +1,5 @@ # -# Copyright (C) 2006-2009 OpenWrt.org +# Copyright (C) 2006-2010 OpenWrt.org # # This is free software, licensed under the GNU General Public License v2. # See /LICENSE for more information. @@ -45,7 +45,7 @@ else endif DL_DIR:=$(if $(call qstrip,$(CONFIG_DOWNLOAD_FOLDER)),$(call qstrip,$(CONFIG_DOWNLOAD_FOLDER)),$(TOPDIR)/dl) -BIN_DIR:=$(TOPDIR)/bin +BIN_DIR:=$(TOPDIR)/bin/$(BOARD) INCLUDE_DIR:=$(TOPDIR)/include SCRIPT_DIR:=$(TOPDIR)/scripts BUILD_DIR_BASE:=$(TOPDIR)/build_dir @@ -57,11 +57,12 @@ ifeq ($(CONFIG_EXTERNAL_TOOLCHAIN),) LIBCV:=$(call qstrip,$(CONFIG_LIBC_VERSION)) REAL_GNU_TARGET_NAME=$(OPTIMIZE_FOR_CPU)-openwrt-linux$(if $(TARGET_SUFFIX),-$(TARGET_SUFFIX)) GNU_TARGET_NAME=$(OPTIMIZE_FOR_CPU)-openwrt-linux - BUILD_DIR:=$(BUILD_DIR_BASE)/target-$(ARCH)_$(LIBC)-$(LIBCV)$(if $(BUILD_SUFFIX),_$(BUILD_SUFFIX)) - STAGING_DIR:=$(TOPDIR)/staging_dir/target-$(ARCH)_$(LIBC)-$(LIBCV) - BUILD_DIR_TOOLCHAIN:=$(BUILD_DIR_BASE)/toolchain-$(ARCH)_gcc-$(GCCV)_$(LIBC)-$(LIBCV) - TOOLCHAIN_DIR:=$(TOPDIR)/staging_dir/toolchain-$(ARCH)_gcc-$(GCCV)_$(LIBC)-$(LIBCV) - PACKAGE_DIR:=$(BIN_DIR)/packages/$(BOARD)_$(LIBC)-$(LIBCV) + DIR_SUFFIX:=_$(LIBC)-$(LIBCV)$(if $(CONFIG_EABI_SUPPORT),_eabi) + BUILD_DIR:=$(BUILD_DIR_BASE)/target-$(ARCH)$(DIR_SUFFIX)$(if $(BUILD_SUFFIX),_$(BUILD_SUFFIX)) + STAGING_DIR:=$(TOPDIR)/staging_dir/target-$(ARCH)$(DIR_SUFFIX) + BUILD_DIR_TOOLCHAIN:=$(BUILD_DIR_BASE)/toolchain-$(ARCH)_gcc-$(GCCV)$(DIR_SUFFIX) + TOOLCHAIN_DIR:=$(TOPDIR)/staging_dir/toolchain-$(ARCH)_gcc-$(GCCV)$(DIR_SUFFIX) + PACKAGE_DIR:=$(BIN_DIR)/packages else ifeq ($(CONFIG_NATIVE_TOOLCHAIN),) GNU_TARGET_NAME=$(call qstrip,$(CONFIG_TARGET_NAME)) @@ -73,14 +74,13 @@ else STAGING_DIR:=$(TOPDIR)/staging_dir/target-$(GNU_TARGET_NAME) BUILD_DIR_TOOLCHAIN:=$(BUILD_DIR_BASE)/toolchain-$(GNU_TARGET_NAME) TOOLCHAIN_DIR:=$(TOPDIR)/staging_dir/toolchain-$(GNU_TARGET_NAME) - PACKAGE_DIR:=$(BIN_DIR)/packages/$(BOARD)_$(GNU_TARGET_NAME) + PACKAGE_DIR:=$(BIN_DIR)/packages endif STAMP_DIR:=$(BUILD_DIR)/stamp STAMP_DIR_HOST=$(BUILD_DIR_HOST)/stamp TARGET_ROOTFS_DIR?=$(if $(call qstrip,$(CONFIG_TARGET_ROOTFS_DIR)),$(call qstrip,$(CONFIG_TARGET_ROOTFS_DIR)),$(BUILD_DIR)) TARGET_DIR:=$(TARGET_ROOTFS_DIR)/root-$(BOARD) STAGING_DIR_ROOT:=$(STAGING_DIR)/root-$(BOARD) -DEBUG_DIR:=$(BUILD_DIR)/debug-$(BOARD) BUILD_LOG_DIR:=$(TOPDIR)/logs TARGET_PATH:=$(STAGING_DIR_HOST)/bin:$(PATH) @@ -142,6 +142,7 @@ TARGET_CXX:=$(if $(CONFIG_INSTALL_LIBSTDCPP),$(TARGET_CROSS)g++,no) PATCH:=$(SCRIPT_DIR)/patch-kernel.sh SED:=$(STAGING_DIR_HOST)/bin/sed -i -e CP:=cp -fpR +LN:=ln -sf INSTALL_BIN:=install -m0755 INSTALL_DIR:=install -d -m0755 @@ -174,7 +175,7 @@ ifneq ($(CONFIG_NO_STRIP),) STRIP:=: else ifneq ($(CONFIG_USE_STRIP),) - STRIP:=$(TARGET_CROSS)strip + STRIP:=$(TARGET_CROSS)strip $(call qstrip,$(CONFIG_STRIP_ARGS)) else ifneq ($(CONFIG_USE_SSTRIP),) STRIP:=$(STAGING_DIR_HOST)/bin/sstrip @@ -183,7 +184,7 @@ else RSTRIP:= \ NM="$(TARGET_CROSS)nm" \ STRIP="$(STRIP)" \ - STRIP_KMOD="$(TARGET_CROSS)strip --strip-unneeded --remove-section=.comment --remove-section=.pdr --remove-section=mdebug.abi32" \ + STRIP_KMOD="$(TARGET_CROSS)strip --strip-unneeded --remove-section=.comment --remove-section=.pdr --remove-section=.mdebug.abi32" \ $(SCRIPT_DIR)/rstrip.sh endif @@ -220,6 +221,10 @@ $(call shvar,$(1))=$$(call $(1)) export $(call shvar,$(1)) endef +define include_mk +$(eval -include $(if $(DUMP),,$(STAGING_DIR)/mk/$(strip $(1)))) +endef + # file extension ext=$(word $(words $(subst ., ,$(1))),$(subst ., ,$(1)))