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
; }
39 MAKEFLAGS
=-j
$(BR2_JLEVEL
) V
=$(V
) $(EXTRA_MAKEFLAGS
)
40 # Strip off the annoying quoting
41 ARCH
:=$(strip $(subst ",, $(BR2_ARCH)))
42 WGET:=$(strip $(subst ",, $(BR2_WGET
)))
43 GCC_VERSION
:=$(strip $(subst ",, $(BR2_GCC_VERSION)))
44 GCC_USE_SJLJ_EXCEPTIONS:=$(strip $(subst ",, $(BR2_GCC_USE_SJLJ_EXCEPTIONS
)))
45 TARGET_OPTIMIZATION
:=$(strip $(subst ",, $(BR2_TARGET_OPTIMIZATION)))
46 #"))"))"))"))")) # for vim's broken syntax highlighting :)
49 ifeq ($(BR2_SOFT_FLOAT
),y
)
50 # gcc 3.4.x soft float configuration is different than previous versions.
51 ifeq ($(findstring 3.4.
,$(GCC_VERSION
)),3.4.
)
52 SOFT_FLOAT_CONFIG_OPTION
:=--with-float
=soft
54 SOFT_FLOAT_CONFIG_OPTION
:=--without-float
56 TARGET_SOFT_FLOAT
:=-msoft-float
57 ARCH_FPU_SUFFIX
:=_nofpu
59 SOFT_FLOAT_CONFIG_OPTION
:=
65 ifeq ($(BR2_TAR_VERBOSITY
),y
)
71 ifneq ($(BR2_LARGEFILE
),y
)
72 DISABLE_LARGEFILE
= --disable-largefile
74 TARGET_CFLAGS
:=$(TARGET_OPTIMIZATION
) $(TARGET_DEBUGGING
)
76 OPTIMIZE_FOR_CPU
=$(ARCH
)
79 DL_DIR
:=$(BASE_DIR
)/dl
80 BUILD_DIR
:=$(BASE_DIR
)/build_
$(ARCH
)$(ARCH_FPU_SUFFIX
)
81 STAGING_DIR
:=$(BASE_DIR
)/staging_dir_
$(ARCH
)$(ARCH_FPU_SUFFIX
)
82 SCRIPT_DIR
:=$(BASE_DIR
)/scripts
83 BIN_DIR
:=$(BASE_DIR
)/bin
84 STAMP_DIR
:=$(BUILD_DIR
)/stamp
85 PACKAGE_DIR
:=$(BIN_DIR
)/packages
86 STAMP_DIR
:=$(BUILD_DIR
)/stamp
87 TARGET_DIR
:=$(BUILD_DIR
)/root
88 TOOL_BUILD_DIR
=$(BASE_DIR
)/toolchain_build_
$(ARCH
)$(ARCH_FPU_SUFFIX
)
89 TARGET_PATH
=$(STAGING_DIR
)/usr
/bin
:$(STAGING_DIR
)/bin
:/bin
:/sbin
:/usr
/bin
:/usr
/sbin
90 IMAGE
:=$(BUILD_DIR
)/root_fs_
$(ARCH
)$(ARCH_FPU_SUFFIX
)
91 REAL_GNU_TARGET_NAME
=$(OPTIMIZE_FOR_CPU
)-linux-uclibc
92 GNU_TARGET_NAME
=$(OPTIMIZE_FOR_CPU
)-linux
93 KERNEL_CROSS
:=$(STAGING_DIR
)/bin
/$(OPTIMIZE_FOR_CPU
)-linux-uclibc-
94 TARGET_CROSS
:=$(STAGING_DIR
)/bin
/$(OPTIMIZE_FOR_CPU
)-linux-uclibc-
95 TARGET_CC
:=$(TARGET_CROSS
)gcc
96 STRIP
:=$(STAGING_DIR
)/bin
/sstrip
97 PATCH
=$(SCRIPT_DIR
)/patch-kernel.sh
98 SED
:=$(STAGING_DIR
)/bin
/sed
-i
-e
99 LINUX_DIR
:=$(BUILD_DIR
)/linux
100 LINUX_HEADERS_DIR
:=$(TOOL_BUILD_DIR
)/linux
103 HOST_ARCH
:=$(shell $(HOSTCC
) -dumpmachine | sed
-e s
'/-.*//' \
104 -e
's/sparc.*/sparc/' \
106 -e
's/m68k.*/m68k/' \
107 -e
's/ppc/powerpc/g' \
108 -e
's/v850.*/v850/g' \
110 -e
's/mips-.*/mips/' \
111 -e
's/mipsel-.*/mipsel/' \
112 -e
's/cris.*/cris/' \
113 -e
's/i[3-9]86/i386/' \
115 GNU_HOST_NAME
:=$(HOST_ARCH
)-pc-linux-gnu
116 TARGET_CONFIGURE_OPTS
=PATH
=$(TARGET_PATH
) \
117 AR
=$(TARGET_CROSS
)ar \
118 AS
=$(TARGET_CROSS
)as \
119 LD
=$(TARGET_CROSS
)ld \
120 NM
=$(TARGET_CROSS
)nm \
121 CC
=$(TARGET_CROSS
)gcc \
122 GCC
=$(TARGET_CROSS
)gcc \
123 CXX
=$(TARGET_CROSS
)g
++ \
124 RANLIB
=$(TARGET_CROSS
)ranlib
126 ifeq ($(ENABLE_LOCALE
),true
)
129 DISABLE_NLS
:=--disable-nls
132 ifeq ($(BR2_ENABLE_MULTILIB
),y
)
133 MULTILIB
:=--enable-multilib
136 # invoke ipkg-build with some default options
137 IPKG_BUILD
:= PATH
="$(TARGET_PATH)" ipkg-build
-c
-o root
-g root
138 # where to build (and put) .ipk packages
139 IPKG_TARGET_DIR
:= $(PACKAGE_DIR
)
140 IPKG
:=IPKG_TMP
=$(BUILD_DIR
)/tmp IPKG_INSTROOT
=$(TARGET_DIR
) IPKG_CONF_DIR
=$(STAGING_DIR
)/etc
$(SCRIPT_DIR
)/ipkg
-force-defaults
-force-depends
141 IPKG_STATE_DIR
:= $(TARGET_DIR
)/usr
/lib
/ipkg
143 RSTRIP
:=STRIP
="$(STRIP)" $(SCRIPT_DIR
)/rstrip.sh
144 RSTRIP_KMOD
:=STRIP
="$(TARGET_CROSS)strip --strip-unneeded --remove-section=.comment" $(SCRIPT_DIR
)/rstrip.sh