2 # Copyright (C) 2006 OpenWrt.org
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
7 include $(TOPDIR
)/rules.mk
8 include $(INCLUDE_DIR
)/target.mk
13 PKG_SOURCE
:=uClibc-
$(PKG_VERSION
).
tar.bz2
14 PKG_SOURCE_URL
:=http
://www.uclibc.org
/downloads
15 PKG_MD5SUM
:=1ada58d919a82561061e4741fb6abd29
18 PKG_BUILD_DIR
:=$(TOOLCHAIN_BUILD_DIR
)/uClibc-
$(PKG_VERSION
)
20 include $(INCLUDE_DIR
)/host-build.mk
22 UCLIBC_TARGET_ARCH
:=$(shell echo
$(ARCH
) | sed
-e s
'/-.*//' \
24 -e
's/sparc.*/sparc/' \
27 -e
's/ppc/powerpc/g' \
28 -e
's/v850.*/v850/g' \
30 -e
's/sh[234].*/sh/' \
32 -e
's/mipsel.*/mips/' \
37 $(call Build
/Prepare
/Default
)
38 $(SED
) 's,^CROSS=.*,CROSS=$(TARGET_CROSS),g' $(PKG_BUILD_DIR
)/Rules.mak
39 if
[ -e config
/$(ARCH
).
$(BOARD
) ]; then \
40 $(CP
) config
/$(ARCH
).
$(BOARD
) $(PKG_BUILD_DIR
)/.config
; \
42 $(CP
) config
/$(ARCH
) $(PKG_BUILD_DIR
)/.config
; \
44 $(SED
) 's,^KERNEL_SOURCE=.*,KERNEL_SOURCE=\"$(LINUX_HEADERS_DIR)\",g' \
45 $(PKG_BUILD_DIR
)/.config
46 ifeq ($(CONFIG_LARGEFILE
),y
)
47 $(SED
) 's,^.*UCLIBC_HAS_LFS.*,UCLIBC_HAS_LFS=y,g' $(PKG_BUILD_DIR
)/.config
49 $(SED
) 's,^.*UCLIBC_HAS_LFS.*,UCLIBC_HAS_LFS=n,g' $(PKG_BUILD_DIR
)/.config
51 $(SED
) 's,.*UCLIBC_HAS_WCHAR.*,UCLIBC_HAS_WCHAR=y,g' $(PKG_BUILD_DIR
)/.config
52 ifeq ($(CONFIG_SOFT_FLOAT
),y
)
53 $(SED
) 's,.*HAS_FPU.*,HAS_FPU=n\nUCLIBC_HAS_FLOATS=y\nUCLIBC_HAS_SOFT_FLOAT=y,g' $(PKG_BUILD_DIR
)/.config
55 ifeq ($(CONFIG_C99_MATH
),y
)
56 $(SED
) 's,.*DO_C99_MATH.*,DO_C99_MATH=y,g' $(PKG_BUILD_DIR
)/.config
58 mkdir
-p
$(TOOLCHAIN_BUILD_DIR
)/uClibc_dev
/usr
/include
59 mkdir
-p
$(TOOLCHAIN_BUILD_DIR
)/uClibc_dev
/usr
/lib
60 mkdir
-p
$(TOOLCHAIN_BUILD_DIR
)/uClibc_dev
/lib
61 PATH
=$(TARGET_PATH
) $(MAKE
) -C
$(PKG_BUILD_DIR
) \
62 PREFIX
=$(TOOLCHAIN_BUILD_DIR
)/uClibc_dev
/ \
64 RUNTIME_PREFIX
=$(TOOLCHAIN_BUILD_DIR
)/uClibc_dev
/ \
66 CPU_CFLAGS
="$(TARGET_CFLAGS)" \
70 define Build
/Configure
74 PATH
=$(TARGET_PATH
) $(MAKE
) -j
$(CONFIG_JLEVEL
) -C
$(PKG_BUILD_DIR
) \
79 CPU_CFLAGS
="$(TARGET_CFLAGS)" \
84 $(MAKE
) -C
$(PKG_BUILD_DIR
) \
85 PREFIX
=$(STAGING_DIR
)/ \
89 $(MAKE
) -C
$(PKG_BUILD_DIR
) \
90 PREFIX
=$(STAGING_DIR
)/ \
94 echo
$(PKG_VERSION
) > $(STAGING_DIR
)/uclibc_version
98 rm -rf
$(PKG_BUILD_DIR
) $(TOOLCHAIN_BUILD_DIR
)/uClibc_dev
101 $(eval
$(call HostBuild
))