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
14 PKG_SOURCE
:=uClibc-
$(PKG_VERSION
)$(PKG_EXTRAVERSION
).
tar.bz2
15 PKG_SOURCE_URL
:=http
://www.uclibc.org
/downloads
16 PKG_MD5SUM
:=959f25286e317f0d9e2103445c5a14c2
19 STAGING_DIR_HOST
:=$(TOOLCHAIN_DIR
)
20 BUILD_DIR_HOST
:=$(BUILD_DIR_TOOLCHAIN
)
21 PKG_BUILD_DIR
:=$(BUILD_DIR_HOST
)/uClibc-
$(PKG_VERSION
)$(PKG_EXTRAVERSION
)
23 include $(INCLUDE_DIR
)/host-build.mk
25 STAMP_BUILT
:=$(TOOLCHAIN_DIR
)/stamp
/.uclibc_installed
26 STAMP_INSTALLED
:=$(TOOLCHAIN_DIR
)/stamp
/.uclibc-utils_installed
28 UCLIBC_TARGET_ARCH
:=$(shell echo
$(ARCH
) | sed
-e s
'/-.*//' \
30 -e
's/sparc.*/sparc/' \
32 -e
's/avr32.*/avr32/g' \
34 -e
's/ppc/powerpc/g' \
35 -e
's/v850.*/v850/g' \
37 -e
's/sh[234].*/sh/' \
39 -e
's/mipsel.*/mips/' \
44 $(call Build
/Prepare
/Default
)
45 $(CP
) config
/$(ARCH
)$(if
$(wildcard config
/$(ARCH
).
$(BOARD
)),$(BOARD
)) $(PKG_BUILD_DIR
)/.config
46 $(SED
) 's,^KERNEL_SOURCE=.*,KERNEL_SOURCE=\"$(LINUX_HEADERS_DIR)\",g' \
47 -e
's,.*HAS_FPU.*,HAS_FPU=$(if $(CONFIG_SOFT_FLOAT),n\nUCLIBC_HAS_FLOATS=y\nUCLIBC_HAS_SOFT_FLOAT=y,y),g' \
48 -e
's,^.*UCLIBC_HAS_LFS.*,UCLIBC_HAS_LFS=$(if $(CONFIG_LARGEFILE),y,n),g' \
49 -e
's,.*DO_C99_MATH.*,DO_C99_MATH=$(if $(CONFIG_C99_MATH),y,n),g' \
50 $(PKG_BUILD_DIR
)/.config
51 mkdir
-p
$(BUILD_DIR_HOST
)/uClibc_dev
/usr
/include
52 mkdir
-p
$(BUILD_DIR_HOST
)/uClibc_dev
/usr
/lib
53 mkdir
-p
$(BUILD_DIR_HOST
)/uClibc_dev
/lib
54 PATH
=$(TARGET_PATH
) $(MAKE
) -C
$(PKG_BUILD_DIR
) \
55 PREFIX
=$(BUILD_DIR_HOST
)/uClibc_dev
/ \
57 RUNTIME_PREFIX
=$(BUILD_DIR_HOST
)/uClibc_dev
/ \
59 CPU_CFLAGS
="$(TARGET_CFLAGS)" \
63 define Build
/Configure
66 UCLIBC_MAKE
:= PATH
=$(TARGET_PATH
) $(MAKE
) -C
$(PKG_BUILD_DIR
) \
67 $(TARGET_CONFIGURE_OPTS
) \
71 CPU_CFLAGS
="$(TARGET_CFLAGS)"
74 $(SED
) 's,^CROSS=.*,CROSS=$(TARGET_CROSS),g' $(PKG_BUILD_DIR
)/Rules.mak
75 $(UCLIBC_MAKE
) PREFIX
= all
76 $(UCLIBC_MAKE
) PREFIX
=$(STAGING_DIR_HOST
)/ install_runtime install_dev
77 $(SED
) 's,UCLIBC_VERSION=.*,UCLIBC_VERSION=$(PKG_VERSION),' $(TOOLCHAIN_DIR
)/info.mk
78 $(SED
) 's,UCLIBC_PATCHVER=.*,UCLIBC_PATCHVER=$(PKG_EXTRAVERSION),' $(TOOLCHAIN_DIR
)/info.mk
82 $(UCLIBC_MAKE
) PREFIX
= utils
83 $(INSTALL_DIR
) $(TOOLCHAIN_DIR
)/target-utils
85 $(PKG_BUILD_DIR
)/utils
/ldd \
86 $(PKG_BUILD_DIR
)/utils
/ldconfig \
87 $(TOOLCHAIN_DIR
)/target-utils
/
91 rm -rf
$(PKG_BUILD_DIR
) $(BUILD_DIR_HOST
)/uClibc_dev
94 $(eval
$(call HostBuild
))