1 include $(TOPDIR
)/rules.mk
3 #############################################################
5 # uClibc (the C library)
7 #############################################################
9 ifeq ($(CONFIG_UCLIBC_VERSION_SNAPSHOT
),y
)
10 # Be aware that this changes daily....
11 UCLIBC_DIR
:=$(TOOL_BUILD_DIR
)/uClibc
12 UCLIBC_SOURCE
:=uClibc-
$(strip $(subst ",, $(CONFIG_USE_UCLIBC_SNAPSHOT))).tar.bz2#"))
13 UCLIBC_SITE
:=http
://www.uclibc.org
/downloads
/snapshots
14 UCLIBC_VER
:=PKG_VERSION
:=0.
${shell date
+"%G%m%d"}
18 UCLIBC_DIR
:=$(TOOL_BUILD_DIR
)/uClibc-
$(UCLIBC_VER
)
19 UCLIBC_SOURCE
:=uClibc-
$(UCLIBC_VER
).
tar.bz2
20 UCLIBC_SITE
:=http
://www.uclibc.org
/downloads
21 UCLIBC_MD5SUM
:=1ada58d919a82561061e4741fb6abd29
24 UCLIBC_TARGET_ARCH
:=$(shell echo
$(ARCH
) | sed
-e s
'/-.*//' \
26 -e
's/sparc.*/sparc/' \
29 -e
's/ppc/powerpc/g' \
30 -e
's/v850.*/v850/g' \
32 -e
's/sh[234].*/sh/' \
34 -e
's/mipsel.*/mips/' \
39 $(DL_DIR
)/$(UCLIBC_SOURCE
):
41 $(SCRIPT_DIR
)/download.pl
$(DL_DIR
) $(UCLIBC_SOURCE
) $(UCLIBC_MD5SUM
) $(UCLIBC_SITE
)
43 $(UCLIBC_DIR
)/.unpacked
: $(DL_DIR
)/$(UCLIBC_SOURCE
)
44 mkdir
-p
$(TOOL_BUILD_DIR
)
45 bzcat
$(DL_DIR
)/$(UCLIBC_SOURCE
) |
tar -C
$(TOOL_BUILD_DIR
) $(TAR_OPTIONS
) -
46 $(PATCH
) $(UCLIBC_DIR
) .
/patches
47 touch
$(UCLIBC_DIR
)/.unpacked
49 $(UCLIBC_DIR
)/.configured
: $(UCLIBC_DIR
)/.unpacked
50 $(SED
) 's,^CROSS=.*,CROSS=$(TARGET_CROSS),g' $(UCLIBC_DIR
)/Rules.mak
51 $(CP
) .
/files
/config.
$(ARCH
) $(UCLIBC_DIR
)/.config
52 $(SED
) 's,^KERNEL_SOURCE=.*,KERNEL_SOURCE=\"$(LINUX_HEADERS_DIR)\",g' \
54 ifeq ($(CONFIG_LARGEFILE
),y
)
55 $(SED
) 's,^.*UCLIBC_HAS_LFS.*,UCLIBC_HAS_LFS=y,g' $(UCLIBC_DIR
)/.config
57 $(SED
) 's,^.*UCLIBC_HAS_LFS.*,UCLIBC_HAS_LFS=n,g' $(UCLIBC_DIR
)/.config
59 $(SED
) 's,.*UCLIBC_HAS_WCHAR.*,UCLIBC_HAS_WCHAR=y,g' $(UCLIBC_DIR
)/.config
60 ifeq ($(CONFIG_SOFT_FLOAT
),y
)
61 $(SED
) 's,.*HAS_FPU.*,HAS_FPU=n\nUCLIBC_HAS_FLOATS=y\nUCLIBC_HAS_SOFT_FLOAT=y,g' $(UCLIBC_DIR
)/.config
63 mkdir
-p
$(TOOL_BUILD_DIR
)/uClibc_dev
/usr
/include
64 mkdir
-p
$(TOOL_BUILD_DIR
)/uClibc_dev
/usr
/lib
65 mkdir
-p
$(TOOL_BUILD_DIR
)/uClibc_dev
/lib
66 $(MAKE
) -C
$(UCLIBC_DIR
) \
67 PREFIX
=$(TOOL_BUILD_DIR
)/uClibc_dev
/ \
69 RUNTIME_PREFIX
=$(TOOL_BUILD_DIR
)/uClibc_dev
/ \
71 CPU_CFLAGS
="$(TARGET_CFLAGS)" \
73 touch
$(UCLIBC_DIR
)/.configured
75 $(UCLIBC_DIR
)/lib
/libc.a
: $(UCLIBC_DIR
)/.configured
$(LIBFLOAT_TARGET
)
76 $(MAKE
) -C
$(UCLIBC_DIR
) \
81 CPU_CFLAGS
="$(TARGET_CFLAGS)" \
83 touch
-c
$(UCLIBC_DIR
)/lib
/libc.a
85 $(STAGING_DIR
)/lib
/libc.a
: $(UCLIBC_DIR
)/lib
/libc.a
86 $(MAKE
) -C
$(UCLIBC_DIR
) \
87 PREFIX
=$(STAGING_DIR
)/ \
91 $(MAKE
) -C
$(UCLIBC_DIR
) \
92 PREFIX
=$(STAGING_DIR
)/ \
96 echo
$(UCLIBC_VER
) > $(STAGING_DIR
)/uclibc_version
97 touch
-c
$(STAGING_DIR
)/lib
/libc.a
99 source
: $(DL_DIR
)/$(UCLIBC_SOURCE
)
100 prepare
: $(UCLIBC_DIR
)/.configured
101 compile
: $(UCLIBC_DIR
)/lib
/libc.a
102 install: $(STAGING_DIR
)/lib
/libc.a
$(UCLIBC_TARGETS
)
104 rm -rf
$(UCLIBC_DIR
) $(TOOL_BUILD_DIR
)/uClibc_dev