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 UCLIBC_DIR
:=$(TOOL_BUILD_DIR
)/uClibc-0.9
.27
15 UCLIBC_SOURCE
:=uClibc-0.9
.27.
tar.bz2
16 UCLIBC_SITE
:=http
://www.uclibc.org
/downloads
19 UCLIBC_TARGET_ARCH
:=$(shell echo
$(ARCH
) | sed
-e s
'/-.*//' \
21 -e
's/sparc.*/sparc/' \
24 -e
's/ppc/powerpc/g' \
25 -e
's/v850.*/v850/g' \
27 -e
's/sh[234].*/sh/' \
29 -e
's/mipsel.*/mips/' \
34 $(DL_DIR
)/$(UCLIBC_SOURCE
):
36 $(SCRIPT_DIR
)/download.pl
$(DL_DIR
) $(UCLIBC_SOURCE
) x
$(UCLIBC_SITE
)
38 $(UCLIBC_DIR
)/.unpacked
: $(DL_DIR
)/$(UCLIBC_SOURCE
)
39 mkdir
-p
$(TOOL_BUILD_DIR
)
40 bzcat
$(DL_DIR
)/$(UCLIBC_SOURCE
) |
tar -C
$(TOOL_BUILD_DIR
) $(TAR_OPTIONS
) -
41 $(PATCH
) $(UCLIBC_DIR
) .
/patches
42 touch
$(UCLIBC_DIR
)/.unpacked
44 $(UCLIBC_DIR
)/.configured
: $(UCLIBC_DIR
)/.unpacked
45 $(SED
) 's,^CROSS=.*,CROSS=$(TARGET_CROSS),g' $(UCLIBC_DIR
)/Rules.mak
46 ifeq ($(BR2_ENABLE_LOCALE
),y
)
47 cp .
/uClibc.config-locale
$(UCLIBC_DIR
)/.config
49 cp .
/uClibc.config
$(UCLIBC_DIR
)/.config
51 $(SED
) 's,^.*TARGET_$(UCLIBC_TARGET_ARCH).*,TARGET_$(UCLIBC_TARGET_ARCH)=y,g' \
53 $(SED
) 's,^TARGET_ARCH.*,TARGET_ARCH=\"$(UCLIBC_TARGET_ARCH)\",g' $(UCLIBC_DIR
)/.config
54 $(SED
) 's,^KERNEL_SOURCE=.*,KERNEL_SOURCE=\"$(LINUX_HEADERS_DIR)\",g' \
56 $(SED
) 's,^RUNTIME_PREFIX=.*,RUNTIME_PREFIX=\"/\",g' \
58 $(SED
) 's,^DEVEL_PREFIX=.*,DEVEL_PREFIX=\"/usr/\",g' \
60 $(SED
) 's,^SHARED_LIB_LOADER_PREFIX=.*,SHARED_LIB_LOADER_PREFIX=\"/lib\",g' \
62 ifeq ($(BR2_LARGEFILE
),y
)
63 $(SED
) 's,^.*UCLIBC_HAS_LFS.*,UCLIBC_HAS_LFS=y,g' $(UCLIBC_DIR
)/.config
65 $(SED
) 's,^.*UCLIBC_HAS_LFS.*,UCLIBC_HAS_LFS=n,g' $(UCLIBC_DIR
)/.config
67 $(SED
) 's,.*UCLIBC_HAS_WCHAR.*,UCLIBC_HAS_WCHAR=y,g' $(UCLIBC_DIR
)/.config
68 ifeq ($(BR2_SOFT_FLOAT
),y
)
69 $(SED
) 's,.*HAS_FPU.*,HAS_FPU=n\nUCLIBC_HAS_FLOATS=y\nUCLIBC_HAS_SOFT_FLOAT=y,g' $(UCLIBC_DIR
)/.config
71 mkdir
-p
$(TOOL_BUILD_DIR
)/uClibc_dev
/usr
/include
72 mkdir
-p
$(TOOL_BUILD_DIR
)/uClibc_dev
/usr
/lib
73 mkdir
-p
$(TOOL_BUILD_DIR
)/uClibc_dev
/lib
74 $(MAKE1
) -C
$(UCLIBC_DIR
) \
75 PREFIX
=$(TOOL_BUILD_DIR
)/uClibc_dev
/ \
77 RUNTIME_PREFIX
=$(TOOL_BUILD_DIR
)/uClibc_dev
/ \
80 touch
$(UCLIBC_DIR
)/.configured
82 $(UCLIBC_DIR
)/lib
/libc.a
: $(UCLIBC_DIR
)/.configured
$(LIBFLOAT_TARGET
)
83 $(MAKE1
) -C
$(UCLIBC_DIR
) \
89 touch
-c
$(UCLIBC_DIR
)/lib
/libc.a
91 $(STAGING_DIR
)/lib
/libc.a
: $(UCLIBC_DIR
)/lib
/libc.a
92 $(MAKE1
) -C
$(UCLIBC_DIR
) \
93 PREFIX
=$(STAGING_DIR
)/ \
97 $(MAKE1
) -C
$(UCLIBC_DIR
) \
98 PREFIX
=$(STAGING_DIR
)/ \
102 # Build the host utils. Need to add an install target... - disabled
103 # $(MAKE1) -C $(UCLIBC_DIR)/utils \
104 # PREFIX=$(STAGING_DIR) \
105 # HOSTCC="$(HOSTCC)" \
107 touch
-c
$(STAGING_DIR
)/lib
/libc.a
109 ifneq ($(TARGET_DIR
),)
110 $(TARGET_DIR
)/lib
/libc.so
.0: $(STAGING_DIR
)/lib
/libc.a
111 $(MAKE1
) -C
$(UCLIBC_DIR
) \
112 PREFIX
=$(TARGET_DIR
) \
116 touch
-c
$(TARGET_DIR
)/lib
/libc.so
.0
118 $(TARGET_DIR
)/usr
/bin
/ldd
:
119 $(MAKE1
) -C
$(UCLIBC_DIR
) $(TARGET_CONFIGURE_OPTS
) \
120 PREFIX
=$(TARGET_DIR
) utils install_utils
121 touch
-c
$(TARGET_DIR
)/usr
/bin
/ldd
123 UCLIBC_TARGETS
=$(TARGET_DIR
)/lib
/libc.so
.0
126 uclibc-configured
: $(UCLIBC_DIR
)/.configured
128 uclibc
: $(STAGING_DIR
)/lib
/libc.a \
131 uclibc-source
: $(DL_DIR
)/$(UCLIBC_SOURCE
)
133 uclibc-configured-source
: uclibc-source
136 -$(MAKE1
) -C
$(UCLIBC_DIR
) clean
137 rm -f
$(UCLIBC_DIR
)/.config
142 uclibc-target-utils
: $(TARGET_DIR
)/usr
/bin
/ldd
144 #############################################################
146 # uClibc for the target just needs its header files
147 # and whatnot installed.
149 #############################################################
151 $(TARGET_DIR
)/usr
/lib
/libc.a
: $(STAGING_DIR
)/$(REAL_GNU_TARGET_NAME
)/lib
/libc.a
152 $(MAKE1
) -C
$(UCLIBC_DIR
) \
153 PREFIX
=$(TARGET_DIR
) \
157 touch
-c
$(TARGET_DIR
)/usr
/lib
/libc.a
159 uclibc_target
: gcc uclibc
$(TARGET_DIR
)/usr
/lib
/libc.a
$(TARGET_DIR
)/usr
/bin
/ldd
162 rm -f
$(TARGET_DIR
)/include
164 uclibc_target-dirclean
:
165 rm -f
$(TARGET_DIR
)/include