2007-07-17 14:09:07 +02:00
|
|
|
ifndef MAKE
|
|
|
|
MAKE:=make
|
2007-01-30 18:33:53 +01:00
|
|
|
endif
|
2007-07-17 14:09:07 +02:00
|
|
|
ifndef HOSTMAKE
|
|
|
|
HOSTMAKE=$(MAKE)
|
|
|
|
endif
|
|
|
|
HOSTMAKE :=$(shell $(CONFIG_SHELL) -c "which $(HOSTMAKE)" || type -p $(HOSTMAKE) || echo make)
|
|
|
|
|
|
|
|
MAKE1:=$(HOSTMAKE) MAKE="$(firstword $(HOSTMAKE)) -j1"
|
|
|
|
MAKE:=$(HOSTMAKE) -j$(BR2_JLEVEL)
|
2004-12-11 14:01:10 +01:00
|
|
|
|
2004-10-09 03:06:03 +02:00
|
|
|
# Strip off the annoying quoting
|
|
|
|
ARCH:=$(strip $(subst ",, $(BR2_ARCH)))
|
2006-11-17 16:43:51 +01:00
|
|
|
#"))
|
2007-07-20 09:34:28 +02:00
|
|
|
WGET:=$(strip $(subst ",, $(BR2_WGET))) $(SPIDER)
|
2006-11-17 16:43:51 +01:00
|
|
|
#"))
|
2005-01-23 12:20:30 +01:00
|
|
|
SVN:=$(strip $(subst ",, $(BR2_SVN)))
|
2006-11-17 16:43:51 +01:00
|
|
|
#"))
|
2006-10-01 20:34:45 +02:00
|
|
|
ZCAT:=$(strip $(subst ",, $(BR2_ZCAT)))
|
2006-11-17 16:43:51 +01:00
|
|
|
#"))
|
|
|
|
BZCAT:=$(strip $(subst ",, $(BR2_BZCAT)))
|
|
|
|
#"))
|
2006-07-19 00:58:58 +02:00
|
|
|
TAR_OPTIONS=$(subst ",, $(BR2_TAR_OPTIONS)) -xf
|
2006-11-17 16:43:51 +01:00
|
|
|
#")
|
2005-01-23 12:20:30 +01:00
|
|
|
|
|
|
|
|
2007-02-06 19:19:38 +01:00
|
|
|
ifeq ($(BR2_TOOLCHAIN_BUILDROOT),y)
|
2007-06-20 13:26:36 +02:00
|
|
|
TARGET_CFLAGS=$(TARGET_OPTIMIZATION) $(TARGET_DEBUGGING) \
|
2007-07-20 13:36:52 +02:00
|
|
|
-I$(STAGING_DIR)/usr/include -I$(STAGING_DIR)/include
|
2007-06-20 13:26:36 +02:00
|
|
|
TARGET_LDFLAGS=-L$(STAGING_DIR)/lib -L$(STAGING_DIR)/usr/lib
|
|
|
|
|
|
|
|
ifeq ($(BR2_TOOLCHAIN_SYSROOT),y)
|
|
|
|
TARGET_CFLAGS+= $(BR2_SYSROOT) $(BR2_ISYSROOT)
|
|
|
|
#TARGET_LDFLAGS=-Wl,$(BR2_SYSROOT)
|
|
|
|
endif
|
|
|
|
|
2007-07-23 14:03:17 +02:00
|
|
|
CC_TARGET_TUNE_:=$(strip $(subst ",,$(BR2_GCC_TARGET_TUNE)))
|
2007-07-23 13:37:25 +02:00
|
|
|
#"))
|
2007-07-23 14:03:17 +02:00
|
|
|
CC_TARGET_ARCH_:=$(strip $(subst ",,$(BR2_GCC_TARGET_ARCH)))
|
2007-07-23 13:37:25 +02:00
|
|
|
#"))
|
2007-07-23 14:03:17 +02:00
|
|
|
CC_TARGET_ABI_:=$(strip $(subst ",,$(BR2_GCC_TARGET_ABI)))
|
2007-07-23 13:37:25 +02:00
|
|
|
#"))
|
|
|
|
ifneq ($(CC_TARGET_TUNE_),)
|
|
|
|
TARGET_CFLAGS+=-mtune=$(CC_TARGET_TUNE_)
|
|
|
|
endif
|
|
|
|
ifneq ($(CC_TARGET_ARCH_),)
|
|
|
|
TARGET_CFLAGS+=-march=$(CC_TARGET_ARCH_)
|
|
|
|
endif
|
|
|
|
ifneq ($(CC_TARGET_ABI_),)
|
|
|
|
TARGET_CFLAGS+=-mabi=$(CC_TARGET_ABI_)
|
|
|
|
endif
|
|
|
|
|
2007-06-20 13:26:36 +02:00
|
|
|
ifneq ($(BR2_PREFER_STATIC_LIB),y)
|
|
|
|
ifeq ($(BR2_x86_64),y)
|
|
|
|
TARGET_CFLAGS+=-fPIC -DPIC
|
|
|
|
endif # PIC for dynamic objects on x86_64
|
|
|
|
endif
|
2007-06-26 16:02:29 +02:00
|
|
|
|
|
|
|
ifeq ($(BR2_SOFT_FLOAT),y)
|
|
|
|
TARGET_CFLAGS+=-msoft-float
|
|
|
|
endif
|
|
|
|
|
|
|
|
|
2007-06-20 13:26:36 +02:00
|
|
|
# else it's an external toolchain
|
2007-06-26 16:02:29 +02:00
|
|
|
#########################################################################
|
2007-02-06 19:19:38 +01:00
|
|
|
else
|
2007-05-07 06:01:24 +02:00
|
|
|
TARGET_CFLAGS=$(TARGET_OPTIMIZATION) $(TARGET_DEBUGGING) -I$(STAGING_DIR)/include -I$(STAGING_DIR)/usr/include -I$(TOOLCHAIN_EXTERNAL_PATH)/$(TOOLCHAIN_EXTERNAL_PREFIX)/include
|
2007-02-06 19:19:38 +01:00
|
|
|
TARGET_LDFLAGS=-L$(STAGING_DIR)/lib -L$(STAGING_DIR)/usr/lib
|
|
|
|
endif
|
2007-06-26 16:02:29 +02:00
|
|
|
#########################################################################
|
2007-06-20 13:26:36 +02:00
|
|
|
|
|
|
|
|
|
|
|
BASE_DIR:=$(shell pwd)
|
2004-10-09 03:06:03 +02:00
|
|
|
|
2005-09-18 06:41:57 +02:00
|
|
|
TOPDIR_PREFIX:=$(strip $(subst ",, $(BR2_TOPDIR_PREFIX)))_
|
2006-11-17 16:43:51 +01:00
|
|
|
#"))
|
2005-09-18 06:41:57 +02:00
|
|
|
TOPDIR_SUFFIX:=_$(strip $(subst ",, $(BR2_TOPDIR_SUFFIX)))
|
2006-11-17 16:43:51 +01:00
|
|
|
#"))
|
2005-09-18 06:41:57 +02:00
|
|
|
ifeq ($(TOPDIR_PREFIX),_)
|
|
|
|
TOPDIR_PREFIX:=
|
|
|
|
endif
|
|
|
|
ifeq ($(TOPDIR_SUFFIX),_)
|
|
|
|
TOPDIR_SUFFIX:=
|
|
|
|
endif
|
|
|
|
|
2005-10-01 02:35:24 +02:00
|
|
|
DL_DIR=$(strip $(subst ",, $(BR2_DL_DIR)))
|
2006-11-17 16:43:51 +01:00
|
|
|
#"))
|
2005-10-01 02:35:24 +02:00
|
|
|
ifeq ($(DL_DIR),)
|
2004-10-27 20:13:38 +02:00
|
|
|
DL_DIR:=$(BASE_DIR)/dl
|
2005-10-01 02:35:24 +02:00
|
|
|
endif
|
2004-10-27 20:13:38 +02:00
|
|
|
#PATCH_DIR=$(BASE_DIR)/sources/patches
|
2007-07-12 17:32:04 +02:00
|
|
|
|
|
|
|
# All non-configurable packages should be built in BUILD_DIR
|
2005-09-18 06:41:57 +02:00
|
|
|
BUILD_DIR:=$(BASE_DIR)/$(TOPDIR_PREFIX)build_$(ARCH)$(ARCH_FPU_SUFFIX)$(TOPDIR_SUFFIX)
|
2007-07-12 15:11:03 +02:00
|
|
|
|
2007-07-12 17:32:04 +02:00
|
|
|
# All configurable packages (like Busybox,Linux etc) should be built in PROJECT_BUILD_DIR
|
2007-07-12 15:11:03 +02:00
|
|
|
PROJECT_BUILD_DIR:=$(BASE_DIR)/$(TOPDIR_PREFIX)project_build_$(ARCH)$(ARCH_FPU_SUFFIX)$(TOPDIR_SUFFIX)/$(PROJECT)
|
|
|
|
BINARIES_DIR:=$(BASE_DIR)/binaries/$(PROJECT)
|
|
|
|
TARGET_DIR:=$(PROJECT_BUILD_DIR)/root
|
|
|
|
|
2005-09-18 06:41:57 +02:00
|
|
|
|
2006-06-05 23:49:44 +02:00
|
|
|
GNU_TARGET_SUFFIX:=-$(strip $(subst ",, $(BR2_GNU_TARGET_SUFFIX)))
|
2006-11-17 16:43:51 +01:00
|
|
|
#"))
|
|
|
|
|
2004-12-11 11:25:40 +01:00
|
|
|
STAGING_DIR:=$(strip $(subst ",, $(BR2_STAGING_DIR)))
|
2006-11-17 16:43:51 +01:00
|
|
|
#"))
|
2007-02-06 19:19:38 +01:00
|
|
|
ifeq ($(BR2_TOOLCHAIN_BUILDROOT),y)
|
|
|
|
TOOL_BUILD_DIR=$(BASE_DIR)/$(TOPDIR_PREFIX)toolchain_build_$(ARCH)$(ARCH_FPU_SUFFIX)$(TOPDIR_SUFFIX)
|
2006-11-17 16:43:51 +01:00
|
|
|
|
2006-12-08 13:45:45 +01:00
|
|
|
# Quotes are needed for spaces et al in path components.
|
2007-06-20 13:26:36 +02:00
|
|
|
TARGET_PATH="$(TOOL_BUILD_DIR)/bin:$(STAGING_DIR)/bin:$(STAGING_DIR)/usr/bin:$(PATH)"
|
2007-07-12 15:11:03 +02:00
|
|
|
IMAGE:=$(BINARIES_DIR)/rootfs.$(ARCH)$(ARCH_FPU_SUFFIX)
|
2004-10-09 03:06:03 +02:00
|
|
|
GNU_TARGET_NAME=$(OPTIMIZE_FOR_CPU)-linux
|
2007-06-20 13:26:36 +02:00
|
|
|
REAL_GNU_TARGET_NAME=$(OPTIMIZE_FOR_CPU)$(GNU_TARGET_SUFFIX)
|
|
|
|
TARGET_CROSS=$(STAGING_DIR)/usr/bin/$(REAL_GNU_TARGET_NAME)-
|
|
|
|
KERNEL_CROSS=$(TARGET_CROSS)
|
2007-02-06 19:19:38 +01:00
|
|
|
else
|
|
|
|
TOOLCHAIN_EXTERNAL_PREFIX:=$(strip $(subst ",, $(BR2_TOOLCHAIN_EXTERNAL_PREFIX)))
|
|
|
|
#"))
|
|
|
|
TOOLCHAIN_EXTERNAL_PATH:=$(strip $(subst ",, $(BR2_TOOLCHAIN_EXTERNAL_PATH)))
|
|
|
|
#"))
|
|
|
|
TOOL_BUILD_DIR=$(BASE_DIR)/$(TOPDIR_PREFIX)toolchain_build_$(TOOLCHAIN_EXTERNAL_PREFIX)
|
|
|
|
TARGET_PATH="$(STAGING_DIR)/bin:$(TOOL_BUILD_DIR)/bin:$(TOOLCHAIN_EXTERNAL_PATH)/bin:$(PATH)"
|
2007-07-12 15:11:03 +02:00
|
|
|
IMAGE:=$(BINARIES_DIR)/rootfs.$(TOOLCHAIN_EXTERNAL_PREFIX)
|
2007-07-22 19:17:03 +02:00
|
|
|
|
2007-02-06 19:19:38 +01:00
|
|
|
REAL_GNU_TARGET_NAME=$(TOOLCHAIN_EXTERNAL_PREFIX)
|
|
|
|
GNU_TARGET_NAME=$(TOOLCHAIN_EXTERNAL_PREFIX)
|
|
|
|
KERNEL_CROSS=$(TOOLCHAIN_EXTERNAL_PATH)/bin/$(TOOLCHAIN_EXTERNAL_PREFIX)-
|
|
|
|
TARGET_CROSS=$(TOOLCHAIN_EXTERNAL_PATH)/bin/$(TOOLCHAIN_EXTERNAL_PREFIX)-
|
|
|
|
endif
|
2004-10-09 03:06:03 +02:00
|
|
|
TARGET_CC=$(TARGET_CROSS)gcc
|
2006-01-25 18:28:23 +01:00
|
|
|
TARGET_CXX=$(TARGET_CROSS)g++
|
2005-05-18 05:42:51 +02:00
|
|
|
TARGET_RANLIB=$(TARGET_CROSS)ranlib
|
2004-10-09 03:06:03 +02:00
|
|
|
STRIP=$(TARGET_CROSS)strip --remove-section=.comment --remove-section=.note
|
2005-02-16 20:48:03 +01:00
|
|
|
INSTALL=/usr/bin/install
|
2004-10-09 03:06:03 +02:00
|
|
|
|
|
|
|
|
|
|
|
HOST_ARCH:=$(shell $(HOSTCC) -dumpmachine | sed -e s'/-.*//' \
|
|
|
|
-e 's/sparc.*/sparc/' \
|
|
|
|
-e 's/arm.*/arm/g' \
|
|
|
|
-e 's/m68k.*/m68k/' \
|
|
|
|
-e 's/ppc/powerpc/g' \
|
|
|
|
-e 's/v850.*/v850/g' \
|
|
|
|
-e 's/sh[234]/sh/' \
|
|
|
|
-e 's/mips-.*/mips/' \
|
|
|
|
-e 's/mipsel-.*/mipsel/' \
|
|
|
|
-e 's/cris.*/cris/' \
|
|
|
|
-e 's/i[3-9]86/i386/' \
|
|
|
|
)
|
2005-12-27 09:42:13 +01:00
|
|
|
GNU_HOST_NAME:=$(HOST_ARCH)-$(subst ",,$(BR2_GNU_BUILD_SUFFIX))
|
2006-11-17 16:43:51 +01:00
|
|
|
#")
|
2004-10-09 03:06:03 +02:00
|
|
|
TARGET_CONFIGURE_OPTS=PATH=$(TARGET_PATH) \
|
|
|
|
AR=$(TARGET_CROSS)ar \
|
|
|
|
AS=$(TARGET_CROSS)as \
|
2007-07-06 06:26:32 +02:00
|
|
|
LD="$(TARGET_CROSS)ld $(TARGET_LDFLAGS)" \
|
2004-10-09 03:06:03 +02:00
|
|
|
NM=$(TARGET_CROSS)nm \
|
2007-07-06 06:26:32 +02:00
|
|
|
CC="$(TARGET_CROSS)gcc $(TARGET_CFLAGS)" \
|
|
|
|
GCC="$(TARGET_CROSS)gcc $(TARGET_CFLAGS)" \
|
|
|
|
CXX="$(TARGET_CROSS)g++ $(TARGET_CFLAGS)" \
|
|
|
|
CPP="$(TARGET_CROSS)cpp $(TARGET_CFLAGS)" \
|
2005-04-07 02:25:21 +02:00
|
|
|
RANLIB=$(TARGET_CROSS)ranlib \
|
2006-03-10 09:44:16 +01:00
|
|
|
STRIP=$(TARGET_CROSS)strip \
|
2007-01-14 04:48:13 +01:00
|
|
|
OBJCOPY=$(TARGET_CROSS)objcopy \
|
2007-06-20 13:26:36 +02:00
|
|
|
AR_FOR_BUILD="$(HOSTAR)" \
|
|
|
|
AS_FOR_BUILD="$(HOSTAS)" \
|
|
|
|
CC_FOR_BUILD="$(HOSTCC)" \
|
|
|
|
CXX_FOR_BUILD="$(HOSTCXX)" \
|
|
|
|
LD_FOR_BUILD="$(HOSTLD)" \
|
|
|
|
CFLAGS_FOR_BUILD="$(HOST_CFLAGS)" \
|
|
|
|
LDFLAGS_FOR_BUILD="$(HOST_LDFLAGS)" \
|
|
|
|
PKG_CONFIG_SYSROOT="$(STAGING_DIR)" \
|
|
|
|
PKG_CONFIG="$(STAGING_DIR)/usr/bin/pkg-config"
|
|
|
|
|
|
|
|
HOST_CONFIGURE_OPTS=PATH=$(TARGET_PATH) \
|
|
|
|
AR_FOR_BUILD="$(HOSTAR)" \
|
|
|
|
AS_FOR_BUILD="$(HOSTAS)" \
|
2007-01-14 04:48:13 +01:00
|
|
|
CC_FOR_BUILD="$(HOSTCC)" \
|
2007-06-20 13:26:36 +02:00
|
|
|
GCC_FOR_BUILD="$(HOSTCC)" \
|
|
|
|
CXX_FOR_BUILD="$(HOSTCXX)" \
|
|
|
|
LD_FOR_BUILD="$(HOSTLD)" \
|
|
|
|
CFLAGS_FOR_BUILD="$(HOST_CFLAGS)" \
|
|
|
|
CXXFLAGS_FOR_BUILD="$(HOST_CXXFLAGS)" \
|
|
|
|
LDFLAGS_FOR_BUILD="$(HOST_LDFLAGS)" \
|
|
|
|
AR_FOR_TARGET=$(TARGET_CROSS)ar \
|
|
|
|
AS_FOR_TARGET=$(TARGET_CROSS)as \
|
|
|
|
LD_FOR_TARGET=$(TARGET_CROSS)ld \
|
|
|
|
NM_FOR_TARGET=$(TARGET_CROSS)nm \
|
|
|
|
RANLIB_FOR_TARGET=$(TARGET_CROSS)ranlib \
|
|
|
|
STRIP_FOR_TARGET=$(TARGET_CROSS)strip \
|
|
|
|
OBJCOPY_FOR_TARGET=$(TARGET_CROSS)objcopy
|
|
|
|
|
2007-06-27 11:48:23 +02:00
|
|
|
#######################################################################
|
|
|
|
# settings we need to pass to configure
|
|
|
|
|
|
|
|
# does unaligned access trap?
|
|
|
|
BR2_AC_CV_TRAP_CHECK=ac_cv_lbl_unaligned_fail=yes
|
|
|
|
ifeq ($(BR2_i386),y)
|
|
|
|
BR2_AC_CV_TRAP_CHECK=ac_cv_lbl_unaligned_fail=no
|
|
|
|
endif
|
|
|
|
ifeq ($(BR2_x86_64),y)
|
|
|
|
BR2_AC_CV_TRAP_CHECK=ac_cv_lbl_unaligned_fail=no
|
|
|
|
endif
|
|
|
|
ifeq ($(BR2_m68k),y)
|
|
|
|
BR2_AC_CV_TRAP_CHECK=ac_cv_lbl_unaligned_fail=no
|
|
|
|
endif
|
|
|
|
ifeq ($(BR2_s390),y)
|
|
|
|
BR2_AC_CV_TRAP_CHECK=ac_cv_lbl_unaligned_fail=no
|
|
|
|
endif
|
|
|
|
ifeq ($(BR2_powerpc)$(BR2_ENDIAN),yBIG)
|
|
|
|
BR2_AC_CV_TRAP_CHECK=ac_cv_lbl_unaligned_fail=no
|
|
|
|
endif
|
|
|
|
|
2007-06-27 14:01:27 +02:00
|
|
|
ifeq ($(BR2_ENDIAN),"BIG")
|
|
|
|
BR2_AC_CV_C_BIGENDIAN=ac_cv_c_bigendian=yes
|
|
|
|
else
|
|
|
|
BR2_AC_CV_C_BIGENDIAN=ac_cv_c_bigendian=no
|
|
|
|
endif
|
|
|
|
|
2007-06-27 11:48:23 +02:00
|
|
|
TARGET_CONFIGURE_ARGS= \
|
|
|
|
$(BR2_AC_CV_TRAP_CHECK) \
|
2007-06-27 14:01:27 +02:00
|
|
|
ac_cv_func_mmap_fixed_mapped=yes \
|
|
|
|
ac_cv_func_memcmp_working=yes \
|
|
|
|
$(BR2_AC_CV_C_BIGENDIAN)
|
2004-10-09 03:06:03 +02:00
|
|
|
|
2007-06-27 11:48:23 +02:00
|
|
|
#######################################################################
|
|
|
|
|
2006-10-17 18:57:02 +02:00
|
|
|
ifeq ($(BR2_ENABLE_LOCALE),y)
|
2004-10-09 03:06:03 +02:00
|
|
|
DISABLE_NLS:=
|
|
|
|
else
|
|
|
|
DISABLE_NLS:=--disable-nls
|
|
|
|
endif
|
|
|
|
|
2006-12-21 14:51:53 +01:00
|
|
|
ifneq ($(BR2_LARGEFILE),y)
|
|
|
|
DISABLE_LARGEFILE= --disable-largefile
|
|
|
|
endif
|
|
|
|
|
2007-06-26 18:34:45 +02:00
|
|
|
ifneq ($(BR2_INET_IPV6),y)
|
|
|
|
DISABLE_IPV6= --disable-ipv6
|
|
|
|
endif
|
|
|
|
|
2006-12-21 14:51:53 +01:00
|
|
|
ifeq ($(BR2_INSTALL_LIBSTDCPP),)
|
|
|
|
TARGET_CONFIGURE_OPTS+=CXX=""
|
|
|
|
endif
|
2004-10-09 03:06:03 +02:00
|
|
|
|
2007-06-20 13:26:36 +02:00
|
|
|
|
2007-06-27 11:48:23 +02:00
|
|
|
|
2007-02-04 20:47:41 +01:00
|
|
|
# X Windowing system
|
|
|
|
|
|
|
|
XSERVER:=
|
|
|
|
ifeq ($(strip $(BR2_PACKAGE_TINYX)),y)
|
|
|
|
XSERVER+=tinyx
|
|
|
|
endif
|
|
|
|
ifeq ($(strip $(BR2_PACKAGE_XORG)),y)
|
|
|
|
XSERVER+=xorg
|
|
|
|
endif
|
|
|
|
ifeq ($(strip $(BR2_PACKAGE_XGGI)),y)
|
|
|
|
XSERVER+=xggi
|
|
|
|
endif
|
|
|
|
|