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 mkdir
-p
$(TOOLCHAIN_BUILD_DIR
)/uClibc_dev
/usr
/include
56 mkdir
-p
$(TOOLCHAIN_BUILD_DIR
)/uClibc_dev
/usr
/lib
57 mkdir
-p
$(TOOLCHAIN_BUILD_DIR
)/uClibc_dev
/lib
58 PATH
=$(TARGET_PATH
) $(MAKE
) -C
$(PKG_BUILD_DIR
) \
59 PREFIX
=$(TOOLCHAIN_BUILD_DIR
)/uClibc_dev
/ \
61 RUNTIME_PREFIX
=$(TOOLCHAIN_BUILD_DIR
)/uClibc_dev
/ \
63 CPU_CFLAGS
="$(TARGET_CFLAGS)" \
67 define Build
/Configure
71 PATH
=$(TARGET_PATH
) $(MAKE
) -C
$(PKG_BUILD_DIR
) \
76 CPU_CFLAGS
="$(TARGET_CFLAGS)" \
81 $(MAKE
) -C
$(PKG_BUILD_DIR
) \
82 PREFIX
=$(STAGING_DIR
)/ \
86 $(MAKE
) -C
$(PKG_BUILD_DIR
) \
87 PREFIX
=$(STAGING_DIR
)/ \
91 echo
$(PKG_VERSION
) > $(STAGING_DIR
)/uclibc_version
95 rm -rf
$(PKG_BUILD_DIR
) $(TOOLCHAIN_BUILD_DIR
)/uClibc_dev
98 $(eval
$(call HostBuild
))