X-Git-Url: http://git.rohieb.name/openwrt.git/blobdiff_plain/8e52b00c08077ea9d8a8c7dac30be9c98d0ad833..de63af83abff9b31c782aa8715ab7a63c89bbeed:/rules.mk?ds=sidebyside diff --git a/rules.mk b/rules.mk index 315e998b9..9e27710e2 100644 --- a/rules.mk +++ b/rules.mk @@ -4,7 +4,6 @@ # This is free software, licensed under the GNU General Public License v2. # See /LICENSE for more information. # -# $Id$ ifneq ($(__rules_inc),1) __rules_inc=1 @@ -29,6 +28,7 @@ confvar=$(call merge,$(foreach v,$(1),$(if $($(v)),y,n))) strip_last=$(patsubst %.$(lastword $(subst .,$(space),$(1))),%,$(1)) _SINGLE=export MAKEFLAGS=$(space); +CFLAGS:= ARCH:=$(subst i486,i386,$(subst i586,i386,$(subst i686,i386,$(call qstrip,$(CONFIG_ARCH))))) BOARD:=$(call qstrip,$(CONFIG_TARGET_BOARD)) TARGET_OPTIMIZATION:=$(call qstrip,$(CONFIG_TARGET_OPTIMIZATION)) @@ -63,13 +63,16 @@ 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:=$(TOOLCHAIN_DIR)/usr/bin:$(STAGING_DIR_HOST)/bin:$(STAGING_DIR)/host/bin:$(PATH) +TARGET_PATH:=$(TOOLCHAIN_DIR)/usr/bin:$(STAGING_DIR_HOST)/bin:$(PATH) +TARGET_PATH_PKG:=$(STAGING_DIR)/host/bin:$(TARGET_PATH) TARGET_CFLAGS:=$(TARGET_OPTIMIZATION)$(if $(CONFIG_DEBUG), -g3) TARGET_CPPFLAGS:=-I$(STAGING_DIR)/usr/include -I$(STAGING_DIR)/include TARGET_LDFLAGS:=-L$(TOOLCHAIN_DIR)/usr/lib -L$(TOOLCHAIN_DIR)/lib -L$(STAGING_DIR)/usr/lib -L$(STAGING_DIR)/lib -LIBGCC_S=$(if $(wildcard $(TOOLCHAIN_DIR)/lib/libgcc_s.so),-lgcc_s,$(wildcard $(TOOLCHAIN_DIR)/lib/gcc/*/*/libgcc.a)) +LIBGCC_S=$(if $(wildcard $(TOOLCHAIN_DIR)/lib/libgcc_s.so),-L$(TOOLCHAIN_DIR)/lib -lgcc_s,$(wildcard $(TOOLCHAIN_DIR)/lib/gcc/*/*/libgcc.a)) ifndef DUMP ifeq ($(CONFIG_NATIVE_TOOLCHAIN),) @@ -101,8 +104,7 @@ HOST_CFLAGS:=-O2 -I$(STAGING_DIR_HOST)/include HOST_LDFLAGS:=-L$(STAGING_DIR_HOST)/lib TARGET_CC:=$(TARGET_CROSS)gcc -TARGET_CXX:=$(TARGET_CROSS)g++ -STRIP:=$(STAGING_DIR_HOST)/bin/sstrip +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 @@ -135,7 +137,15 @@ TARGET_CONFIGURE_OPTS:= \ # strip an entire directory ifneq ($(CONFIG_NO_STRIP),) RSTRIP:=: + STRIP:=: else + ifneq ($(CONFIG_USE_STRIP),) + STRIP:=$(TARGET_CROSS)strip + else + ifneq ($(CONFIG_USE_SSTRIP),) + STRIP:=$(STAGING_DIR_HOST)/bin/sstrip + endif + endif RSTRIP:= \ NM="$(TARGET_CROSS)nm" \ STRIP="$(STRIP)" \ @@ -144,13 +154,21 @@ else endif ifeq ($(CONFIG_ENABLE_LOCALE),true) - DISABLE_NLS:= + DISABLE_NLS:=--enable-nls else DISABLE_NLS:=--disable-nls endif -ifneq ($(CONFIG_LARGEFILE),y) - DISABLE_LARGEFILE= --disable-largefile +ifeq ($(CONFIG_IPV6),y) + DISABLE_IPV6:= +else + DISABLE_IPV6:=--disable-ipv6 +endif + +ifeq ($(CONFIG_LARGEFILE),y) + DISABLE_LARGEFILE:= +else + DISABLE_LARGEFILE:=--disable-largefile endif ifeq ($(CONFIG_TAR_VERBOSITY),y)