summaryrefslogtreecommitdiff
path: root/package/uclibc/Makefile
blob: e961ee86b1db2bf820ee0358c860ec529496d1c1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
# This file is part of the OpenADK project. OpenADK is copyrighted
# material, please see the LICENCE file in the top-level directory.

include $(TOPDIR)/rules.mk
include $(TOPDIR)/toolchain/uClibc/Makefile.inc

PKG_DESCR:=		embedded C library
PKG_SECTION:=		base
NO_DISTFILES:=		1
PKG_OPTS:=		noremove

include $(TOPDIR)/mk/package.mk

$(eval $(call PKG_template,UCLIBC,uclibc,$(PKG_VERSION)-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR},${PKG_SECTION},${PKG_OPTS}))
$(eval $(call PKG_template,UCLIBC_DEV,uclibc-dev,$(PKG_VERSION)-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR},${PKG_SECTION},${PKG_OPTS}))

# do nothing, uClibc is already build in toolchain directory
do-install:
	${INSTALL_DIR} $(IDIR_UCLIBC)/lib $(IDIR_UCLIBC)/etc
	# create timezone file
	echo 'CET-1CEST-2,M3.5.0/02:00:00,M10.5.0/03:00:00' > $(IDIR_UCLIBC)/etc/TZ
	$(CP) $(STAGING_DIR)/lib/libgcc_s.so.* $(IDIR_UCLIBC)/lib/
	$(CP) $(STAGING_DIR)/lib/libc.so.* $(IDIR_UCLIBC)/lib/
	$(CP) $(STAGING_DIR)/lib/libuClibc-$(PKG_VERSION).so $(IDIR_UCLIBC)/lib/
	$(CP) $(STAGING_DIR)/lib/ld*-uClibc-$(PKG_VERSION).so $(IDIR_UCLIBC)/lib/
	$(CP) $(STAGING_DIR)/lib/ld*-uClibc.so.* $(IDIR_UCLIBC)/lib/
	-for file in libcrypt libdl libm libnsl libresolv librt libutil; do \
		$(CP) $(STAGING_DIR)/lib/$$file.so.* $(IDIR_UCLIBC)/lib/; \
		$(CP) $(STAGING_DIR)/lib/$$file-$(PKG_VERSION).so $(IDIR_UCLIBC)/lib/; \
	done
	# create links for ldd / gcc
	cd $(IDIR_UCLIBC)/lib && ln -sf ld-uClibc.so.0 ld.so
	cd $(IDIR_UCLIBC)/lib && ln -sf libc.so.0 libc.so
	cd $(IDIR_UCLIBC)/lib && ln -sf libgcc_s.so.1 libgcc_s.so
	# header package
	${INSTALL_DIR} $(IDIR_UCLIBC_DEV)/usr/include/{sys,bits,linux,asm,asm-generic}
	for file in \
		regex errno limits alloca stdint locale ctype \
		stdlib string sgidefs fcntl \
		libintl sched pthread wchar _G_config getopt endian \
		features libio stdio error signal time unistd \
	;do \
		${CP} $(STAGING_DIR)/usr/include/$$file.h \
		$(IDIR_UCLIBC_DEV)/usr/include; \
	done
	${CP} $(STAGING_DIR)/usr/include/asm/*.h $(IDIR_UCLIBC_DEV)/usr/include/asm
	${CP} $(STAGING_DIR)/usr/include/asm-generic/*.h $(IDIR_UCLIBC_DEV)/usr/include/asm-generic
	${CP} $(STAGING_DIR)/usr/include/sys/*.h $(IDIR_UCLIBC_DEV)/usr/include/sys
	${CP} $(STAGING_DIR)/usr/include/bits/*.h $(IDIR_UCLIBC_DEV)/usr/include/bits
	${CP} $(STAGING_DIR)/usr/include/linux/*.h $(IDIR_UCLIBC_DEV)/usr/include/linux

include ${TOPDIR}/mk/pkg-bottom.mk