1 include $(TOPDIR
)/.config
12 START_TRACE
:=echo
-n
"---> "
20 ifeq (${shell [ "$(V)" -ge
5 ] && echo
1},)
25 PKG_TRACE
:=echo
"------> "
28 ifeq (${shell [ "$(V)" -ge
10 ] && echo
1},)
30 MAKE_TRACE
:=2>&1 >&/dev
/null ||
{ echo
"Build failed. Please re-run make with V=99 to see what's going on"; /bin
/false
; }
43 MAKEFLAGS
=-j
$(BR2_JLEVEL
) V
=$(V
) $(EXTRA_MAKEFLAGS
)
44 # Strip off the annoying quoting
45 ARCH
:=$(strip $(subst ",, $(BR2_ARCH)))
46 WGET:=$(strip $(subst ",, $(BR2_WGET
)))
47 GCC_VERSION
:=$(strip $(subst ",, $(BR2_GCC_VERSION)))
48 GCC_USE_SJLJ_EXCEPTIONS:=$(strip $(subst ",, $(BR2_GCC_USE_SJLJ_EXCEPTIONS
)))
49 TARGET_OPTIMIZATION
:=$(strip $(subst ",, $(BR2_TARGET_OPTIMIZATION)))
50 #"))"))"))"))")) # for vim's broken syntax highlighting :)
53 ifeq ($(BR2_SOFT_FLOAT
),y
)
54 # gcc 3.4.x soft float configuration is different than previous versions.
55 ifeq ($(findstring 3.4.
,$(GCC_VERSION
)),3.4.
)
56 SOFT_FLOAT_CONFIG_OPTION
:=--with-float
=soft
58 SOFT_FLOAT_CONFIG_OPTION
:=--without-float
60 TARGET_SOFT_FLOAT
:=-msoft-float
61 ARCH_FPU_SUFFIX
:=_nofpu
63 SOFT_FLOAT_CONFIG_OPTION
:=
69 ifeq ($(BR2_TAR_VERBOSITY
),y
)
75 ifneq ($(BR2_LARGEFILE
),y
)
76 DISABLE_LARGEFILE
= --disable-largefile
78 TARGET_CFLAGS
:=$(TARGET_OPTIMIZATION
) $(TARGET_DEBUGGING
)
80 OPTIMIZE_FOR_CPU
=$(ARCH
)
83 DL_DIR
:=$(BASE_DIR
)/dl
84 BUILD_DIR
:=$(BASE_DIR
)/build_
$(ARCH
)$(ARCH_FPU_SUFFIX
)
85 STAGING_DIR
:=$(BASE_DIR
)/staging_dir_
$(ARCH
)$(ARCH_FPU_SUFFIX
)
86 SCRIPT_DIR
:=$(BASE_DIR
)/scripts
87 BIN_DIR
:=$(BASE_DIR
)/bin
88 STAMP_DIR
:=$(BUILD_DIR
)/stamp
89 PACKAGE_DIR
:=$(BIN_DIR
)/packages
90 STAMP_DIR
:=$(BUILD_DIR
)/stamp
91 TARGET_DIR
:=$(BUILD_DIR
)/root
92 TOOL_BUILD_DIR
=$(BASE_DIR
)/toolchain_build_
$(ARCH
)$(ARCH_FPU_SUFFIX
)
93 TARGET_PATH
=$(STAGING_DIR
)/usr
/bin
:$(STAGING_DIR
)/bin
:/bin
:/sbin
:/usr
/bin
:/usr
/sbin
94 IMAGE
:=$(BUILD_DIR
)/root_fs_
$(ARCH
)$(ARCH_FPU_SUFFIX
)
95 REAL_GNU_TARGET_NAME
=$(OPTIMIZE_FOR_CPU
)-linux-uclibc
96 GNU_TARGET_NAME
=$(OPTIMIZE_FOR_CPU
)-linux
97 KERNEL_CROSS
:=$(STAGING_DIR
)/bin
/$(OPTIMIZE_FOR_CPU
)-linux-uclibc-
98 TARGET_CROSS
:=$(STAGING_DIR
)/bin
/$(OPTIMIZE_FOR_CPU
)-linux-uclibc-
99 TARGET_CC
:=$(TARGET_CROSS
)gcc
100 STRIP
:=$(STAGING_DIR
)/bin
/sstrip
101 PATCH
=$(SCRIPT_DIR
)/patch-kernel.sh
102 SED
:=$(STAGING_DIR
)/bin
/sed
-i
-e
103 LINUX_DIR
:=$(BUILD_DIR
)/linux
104 LINUX_HEADERS_DIR
:=$(TOOL_BUILD_DIR
)/linux
107 HOST_ARCH
:=$(shell $(HOSTCC
) -dumpmachine | sed
-e s
'/-.*//' \
108 -e
's/sparc.*/sparc/' \
110 -e
's/m68k.*/m68k/' \
111 -e
's/ppc/powerpc/g' \
112 -e
's/v850.*/v850/g' \
114 -e
's/mips-.*/mips/' \
115 -e
's/mipsel-.*/mipsel/' \
116 -e
's/cris.*/cris/' \
117 -e
's/i[3-9]86/i386/' \
119 GNU_HOST_NAME
:=$(HOST_ARCH
)-pc-linux-gnu
120 TARGET_CONFIGURE_OPTS
=PATH
=$(TARGET_PATH
) \
121 AR
=$(TARGET_CROSS
)ar \
122 AS
=$(TARGET_CROSS
)as \
123 LD
=$(TARGET_CROSS
)ld \
124 NM
=$(TARGET_CROSS
)nm \
125 CC
=$(TARGET_CROSS
)gcc \
126 GCC
=$(TARGET_CROSS
)gcc \
127 CXX
=$(TARGET_CROSS
)g
++ \
128 RANLIB
=$(TARGET_CROSS
)ranlib
130 ifeq ($(ENABLE_LOCALE
),true
)
133 DISABLE_NLS
:=--disable-nls
136 ifeq ($(BR2_ENABLE_MULTILIB
),y
)
137 MULTILIB
:=--enable-multilib
140 # invoke ipkg-build with some default options
141 IPKG_BUILD
:= PATH
="$(TARGET_PATH)" ipkg-build
-c
-o root
-g root
142 # where to build (and put) .ipk packages
143 IPKG_TARGET_DIR
:= $(PACKAGE_DIR
)
144 IPKG
:=IPKG_TMP
=$(BUILD_DIR
)/tmp IPKG_INSTROOT
=$(TARGET_DIR
) IPKG_CONF_DIR
=$(STAGING_DIR
)/etc IPKG_OFFLINE_ROOT
=$(BUILD_DIR
)/root
$(SCRIPT_DIR
)/ipkg
-force-defaults
-force-depends
145 IPKG_STATE_DIR
:= $(TARGET_DIR
)/usr
/lib
/ipkg
147 RSTRIP
:=STRIP
="$(STRIP)" $(SCRIPT_DIR
)/rstrip.sh
148 RSTRIP_KMOD
:=STRIP
="$(TARGET_CROSS)strip --strip-unneeded --remove-section=.comment" $(SCRIPT_DIR
)/rstrip.sh