1 #############################################################
3 # uClibc (the C library)
5 #############################################################
7 ifeq ($(BR2_UCLIBC_VERSION_SNAPSHOT
),y
)
8 # Be aware that this changes daily....
9 UCLIBC_DIR
:=$(TOOL_BUILD_DIR
)/uClibc
10 UCLIBC_SOURCE
:=uClibc-
$(strip $(subst ",, $(BR2_USE_UCLIBC_SNAPSHOT))).tar.bz2
12 UCLIBC_SITE
:=http
://www.uclibc.org
/downloads
/snapshots
14 # Note: 0.9.26 has known problems. So best use a snapshot until .27 is out.
15 # Anticipate the change.
16 UCLIBC_DIR
:=$(TOOL_BUILD_DIR
)/uClibc-0.9
.27
17 UCLIBC_SOURCE
:=uClibc-0.9
.27.
tar.bz2
18 UCLIBC_SITE
:=http
://www.uclibc.org
/downloads
21 UCLIBC_TARGET_ARCH
:=$(shell echo
$(ARCH
) | sed
-e s
'/-.*//' \
23 -e
's/sparc.*/sparc/' \
26 -e
's/ppc/powerpc/g' \
27 -e
's/v850.*/v850/g' \
29 -e
's/sh[234].*/sh/' \
31 -e
's/mipsel.*/mips/' \
36 $(DL_DIR
)/$(UCLIBC_SOURCE
):
38 $(WGET
) -P
$(DL_DIR
) $(UCLIBC_SITE
)/$(UCLIBC_SOURCE
)
40 $(UCLIBC_DIR
)/.unpacked
: $(DL_DIR
)/$(UCLIBC_SOURCE
)
41 mkdir
-p
$(TOOL_BUILD_DIR
)
42 bzcat
$(DL_DIR
)/$(UCLIBC_SOURCE
) |
tar -C
$(TOOL_BUILD_DIR
) $(TAR_OPTIONS
) -
43 touch
$(UCLIBC_DIR
)/.unpacked
45 $(UCLIBC_DIR
)/.configured
: $(UCLIBC_DIR
)/.unpacked
46 $(SED
) 's,^CROSS=.*,CROSS=$(TARGET_CROSS),g' $(UCLIBC_DIR
)/Rules.mak
47 ifeq ($(BR2_ENABLE_LOCALE
),y
)
48 cp toolchain
/uClibc
/uClibc.config-locale
$(UCLIBC_DIR
)/.config
50 cp toolchain
/uClibc
/uClibc.config
$(UCLIBC_DIR
)/.config
52 $(SED
) 's,^.*TARGET_$(UCLIBC_TARGET_ARCH).*,TARGET_$(UCLIBC_TARGET_ARCH)=y,g' \
54 $(SED
) 's,^TARGET_ARCH.*,TARGET_ARCH=\"$(UCLIBC_TARGET_ARCH)\",g' $(UCLIBC_DIR
)/.config
55 $(SED
) 's,^KERNEL_SOURCE=.*,KERNEL_SOURCE=\"$(LINUX_HEADERS_DIR)\",g' \
57 $(SED
) 's,^RUNTIME_PREFIX=.*,RUNTIME_PREFIX=\"/\",g' \
59 $(SED
) 's,^DEVEL_PREFIX=.*,DEVEL_PREFIX=\"/usr/\",g' \
61 $(SED
) 's,^SHARED_LIB_LOADER_PREFIX=.*,SHARED_LIB_LOADER_PREFIX=\"/lib\",g' \
63 ifeq ($(BR2_LARGEFILE
),y
)
64 $(SED
) 's,^.*UCLIBC_HAS_LFS.*,UCLIBC_HAS_LFS=y,g' $(UCLIBC_DIR
)/.config
66 $(SED
) 's,^.*UCLIBC_HAS_LFS.*,UCLIBC_HAS_LFS=n,g' $(UCLIBC_DIR
)/.config
68 $(SED
) 's,.*UCLIBC_HAS_WCHAR.*,UCLIBC_HAS_WCHAR=y,g' $(UCLIBC_DIR
)/.config
69 ifeq ($(BR2_SOFT_FLOAT
),y
)
70 $(SED
) 's,.*HAS_FPU.*,HAS_FPU=n\nUCLIBC_HAS_FLOATS=y\nUCLIBC_HAS_SOFT_FLOAT=y,g' $(UCLIBC_DIR
)/.config
72 mkdir
-p
$(TOOL_BUILD_DIR
)/uClibc_dev
/usr
/include
73 mkdir
-p
$(TOOL_BUILD_DIR
)/uClibc_dev
/usr
/lib
74 mkdir
-p
$(TOOL_BUILD_DIR
)/uClibc_dev
/lib
75 $(MAKE1
) -C
$(UCLIBC_DIR
) \
76 PREFIX
=$(TOOL_BUILD_DIR
)/uClibc_dev
/ \
78 RUNTIME_PREFIX
=$(TOOL_BUILD_DIR
)/uClibc_dev
/ \
81 touch
$(UCLIBC_DIR
)/.configured
83 $(UCLIBC_DIR
)/lib
/libc.a
: $(UCLIBC_DIR
)/.configured
$(LIBFLOAT_TARGET
)
84 $(MAKE1
) -C
$(UCLIBC_DIR
) \
90 touch
-c
$(UCLIBC_DIR
)/lib
/libc.a
92 $(STAGING_DIR
)/lib
/libc.a
: $(UCLIBC_DIR
)/lib
/libc.a
93 $(MAKE1
) -C
$(UCLIBC_DIR
) \
94 PREFIX
=$(STAGING_DIR
)/ \
98 $(MAKE1
) -C
$(UCLIBC_DIR
) \
99 PREFIX
=$(STAGING_DIR
)/ \
103 # Build the host utils. Need to add an install target...
104 $(MAKE1
) -C
$(UCLIBC_DIR
)/utils \
105 PREFIX
=$(STAGING_DIR
) \
108 touch
-c
$(STAGING_DIR
)/lib
/libc.a
110 ifneq ($(TARGET_DIR
),)
111 $(TARGET_DIR
)/lib
/libc.so
.0: $(STAGING_DIR
)/lib
/libc.a
112 $(MAKE1
) -C
$(UCLIBC_DIR
) \
113 PREFIX
=$(TARGET_DIR
) \
117 touch
-c
$(TARGET_DIR
)/lib
/libc.so
.0
119 $(TARGET_DIR
)/usr
/bin
/ldd
:
120 $(MAKE1
) -C
$(UCLIBC_DIR
) $(TARGET_CONFIGURE_OPTS
) \
121 PREFIX
=$(TARGET_DIR
) utils install_utils
122 touch
-c
$(TARGET_DIR
)/usr
/bin
/ldd
124 UCLIBC_TARGETS
=$(TARGET_DIR
)/lib
/libc.so
.0
127 uclibc-configured
: $(UCLIBC_DIR
)/.configured
129 uclibc
: $(STAGING_DIR
)/bin
/$(REAL_GNU_TARGET_NAME
)-gcc
$(STAGING_DIR
)/lib
/libc.a \
132 uclibc-source
: $(DL_DIR
)/$(UCLIBC_SOURCE
)
134 uclibc-configured-source
: uclibc-source
137 -$(MAKE1
) -C
$(UCLIBC_DIR
) clean
138 rm -f
$(UCLIBC_DIR
)/.config
143 uclibc-target-utils
: $(TARGET_DIR
)/usr
/bin
/ldd
145 #############################################################
147 # uClibc for the target just needs its header files
148 # and whatnot installed.
150 #############################################################
152 $(TARGET_DIR
)/usr
/lib
/libc.a
: $(STAGING_DIR
)/$(REAL_GNU_TARGET_NAME
)/lib
/libc.a
153 $(MAKE1
) -C
$(UCLIBC_DIR
) \
154 PREFIX
=$(TARGET_DIR
) \
158 touch
-c
$(TARGET_DIR
)/usr
/lib
/libc.a
160 uclibc_target
: gcc uclibc
$(TARGET_DIR
)/usr
/lib
/libc.a
$(TARGET_DIR
)/usr
/bin
/ldd
163 rm -f
$(TARGET_DIR
)/include
165 uclibc_target-dirclean
:
166 rm -f
$(TARGET_DIR
)/include