1 include $(TOPDIR
)/.config
13 START_TRACE
:=echo
-n
"---> "
21 ifeq (${shell [ "$(V)" -ge
5 ] && echo
1},)
26 PKG_TRACE
:=echo
"------> "
29 ifeq (${shell [ "$(V)" -ge
10 ] && echo
1},)
31 MAKE_TRACE
:=2>&1 >&/dev
/null ||
{ echo
"Build failed. Please re-run make with V=99 to see what's going on"; /bin
/false
; }
44 MAKEFLAGS
=-j
$(CONFIG_JLEVEL
) V
=$(V
) $(EXTRA_MAKEFLAGS
)
45 # Strip off the annoying quoting
46 ARCH
:=$(strip $(subst ",, $(CONFIG_ARCH)))
47 WGET:=$(strip $(subst ",, $(CONFIG_WGET
)))
48 GCC_VERSION
:=$(strip $(subst ",, $(CONFIG_GCC_VERSION)))
49 GCC_USE_SJLJ_EXCEPTIONS:=$(strip $(subst ",, $(CONFIG_GCC_USE_SJLJ_EXCEPTIONS
)))
50 TARGET_OPTIMIZATION
:=$(strip $(subst ",, $(CONFIG_TARGET_OPTIMIZATION)))
51 #"))"))"))"))")) # for vim's broken syntax highlighting :)
54 ifeq ($(CONFIG_SOFT_FLOAT
),y
)
55 # gcc 3.4.x soft float configuration is different than previous versions.
56 ifeq ($(findstring 3.4.
,$(GCC_VERSION
)),3.4.
)
57 SOFT_FLOAT_CONFIG_OPTION
:=--with-float
=soft
59 SOFT_FLOAT_CONFIG_OPTION
:=--without-float
61 TARGET_SOFT_FLOAT
:=-msoft-float
62 ARCH_FPU_SUFFIX
:=_nofpu
64 SOFT_FLOAT_CONFIG_OPTION
:=
70 ifeq ($(CONFIG_TAR_VERBOSITY
),y
)
76 ifneq ($(CONFIG_LARGEFILE
),y
)
77 DISABLE_LARGEFILE
= --disable-largefile
79 TARGET_CFLAGS
:=$(TARGET_OPTIMIZATION
) $(TARGET_DEBUGGING
)
81 OPTIMIZE_FOR_CPU
=$(ARCH
)
84 DL_DIR
:=$(BASE_DIR
)/dl
85 BUILD_DIR
:=$(BASE_DIR
)/build_
$(ARCH
)$(ARCH_FPU_SUFFIX
)
86 STAGING_DIR
:=$(BASE_DIR
)/staging_dir_
$(ARCH
)$(ARCH_FPU_SUFFIX
)
87 SCRIPT_DIR
:=$(BASE_DIR
)/scripts
88 BIN_DIR
:=$(BASE_DIR
)/bin
89 STAMP_DIR
:=$(BUILD_DIR
)/stamp
90 PACKAGE_DIR
:=$(BIN_DIR
)/packages
91 STAMP_DIR
:=$(BUILD_DIR
)/stamp
92 TARGET_DIR
:=$(BUILD_DIR
)/root
93 TOOL_BUILD_DIR
=$(BASE_DIR
)/toolchain_build_
$(ARCH
)$(ARCH_FPU_SUFFIX
)
94 TARGET_PATH
=$(STAGING_DIR
)/usr
/bin
:$(STAGING_DIR
)/bin
:/bin
:/sbin
:/usr
/bin
:/usr
/sbin
95 IMAGE
:=$(BUILD_DIR
)/root_fs_
$(ARCH
)$(ARCH_FPU_SUFFIX
)
96 REAL_GNU_TARGET_NAME
=$(OPTIMIZE_FOR_CPU
)-linux-uclibc
97 GNU_TARGET_NAME
=$(OPTIMIZE_FOR_CPU
)-linux
98 KERNEL_CROSS
:=$(STAGING_DIR
)/bin
/$(OPTIMIZE_FOR_CPU
)-linux-uclibc-
99 TARGET_CROSS
:=$(STAGING_DIR
)/bin
/$(OPTIMIZE_FOR_CPU
)-linux-uclibc-
100 TARGET_CC
:=$(TARGET_CROSS
)gcc
101 STRIP
:=$(STAGING_DIR
)/bin
/sstrip
102 PATCH
=$(SCRIPT_DIR
)/patch-kernel.sh
103 SED
:=$(STAGING_DIR
)/bin
/sed
-i
-e
104 LINUX_DIR
:=$(BUILD_DIR
)/linux
105 LINUX_HEADERS_DIR
:=$(TOOL_BUILD_DIR
)/linux
108 HOST_ARCH
:=$(shell $(HOSTCC
) -dumpmachine | sed
-e s
'/-.*//' \
109 -e
's/sparc.*/sparc/' \
111 -e
's/m68k.*/m68k/' \
112 -e
's/ppc/powerpc/g' \
113 -e
's/v850.*/v850/g' \
115 -e
's/mips-.*/mips/' \
116 -e
's/mipsel-.*/mipsel/' \
117 -e
's/cris.*/cris/' \
118 -e
's/i[3-9]86/i386/' \
120 GNU_HOST_NAME
:=$(HOST_ARCH
)-pc-linux-gnu
121 TARGET_CONFIGURE_OPTS
=PATH
=$(TARGET_PATH
) \
122 AR
=$(TARGET_CROSS
)ar \
123 AS
=$(TARGET_CROSS
)as \
124 LD
=$(TARGET_CROSS
)ld \
125 NM
=$(TARGET_CROSS
)nm \
126 CC
=$(TARGET_CROSS
)gcc \
127 GCC
=$(TARGET_CROSS
)gcc \
128 CXX
=$(TARGET_CROSS
)g
++ \
129 RANLIB
=$(TARGET_CROSS
)ranlib
131 ifeq ($(ENABLE_LOCALE
),true
)
134 DISABLE_NLS
:=--disable-nls
137 ifeq ($(CONFIG_ENABLE_MULTILIB
),y
)
138 MULTILIB
:=--enable-multilib
141 # invoke ipkg-build with some default options
142 IPKG_BUILD
:= PATH
="$(TARGET_PATH)" ipkg-build
-c
-o root
-g root
143 # where to build (and put) .ipk packages
144 IPKG_TARGET_DIR
:= $(PACKAGE_DIR
)
145 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
146 IPKG_STATE_DIR
:= $(TARGET_DIR
)/usr
/lib
/ipkg
148 RSTRIP
:=STRIP
="$(STRIP)" $(SCRIPT_DIR
)/rstrip.sh
149 RSTRIP_KMOD
:=STRIP
="$(TARGET_CROSS)strip --strip-unneeded --remove-section=.comment" $(SCRIPT_DIR
)/rstrip.sh