1 # This file is part of the OpenADK project. OpenADK is copyrighted
2 # material, please see the LICENCE file in the top-level directory.
4 include $(ADK_TOPDIR
)/rules.mk
5 include $(ADK_TOPDIR
)/mk
/$(ADK_TARGET_OS
)-ver.mk
6 include $(ADK_TOPDIR
)/mk
/kernel-vars.mk
7 include $(ADK_TOPDIR
)/toolchain
/musl
/Makefile.inc
10 PKG_DESCR
:= embedded C library
11 PKG_SECTION
:= base
/libs
12 PKG_OPTS
:= noremove nostaging noscripts
14 PKG_SUBPKGS
:= MUSL MUSL_DEV
15 PKGSD_MUSL_DEV
:= development files for musl
16 PKGSC_MUSL_DEV
:= dev
/header
20 include $(ADK_TOPDIR
)/mk
/package.mk
22 $(eval
$(call PKG_template
,MUSL
,musl
,$(PKG_VERSION
)-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR},${PKG_SECTION},${PKG_OPTS}))
23 $(eval
$(call PKG_template
,MUSL_DEV
,musl-dev
,$(PKG_VERSION
)-${PKG_RELEASE},${PKG_DEPENDS},${PKGSD_MUSL_DEV},${PKGSC_MUSL_DEV},${PKG_OPTS}))
27 INSTALL_STYLE
:= manual
29 MUSL_LD_SO
:= "`echo 'void main(void) {}' |${TARGET_CC} ${TARGET_CFLAGS} -x c -o \
30 $(BUILD_DIR)/.musl.tmp - >/dev/null 2>&1 ;\
31 ${TARGET_COMPILER_PREFIX}readelf -l $(BUILD_DIR)/.musl.tmp 2>/dev/null \
32 | grep 'program interpreter: /lib/ld-musl' | sed -e 's|.*lib/||'|sed -e 's|]||' ;\
33 rm $(BUILD_DIR)/.musl.tmp`"
35 # do nothing, musl is already build in toolchain directory
37 ifneq ($(ADK_TARGET_USE_STATIC_LIBS_ONLY
),y
)
38 ${INSTALL_DIR} $(IDIR_MUSL
)/bin
39 ${INSTALL_DIR} $(IDIR_MUSL
)/$(ADK_TARGET_LIBC_PATH
)
40 $(CP
) $(STAGING_TARGET_DIR
)/usr
/lib
/libc.so
$(IDIR_MUSL
)/$(ADK_TARGET_LIBC_PATH
)
41 (cd
$(IDIR_MUSL
)/$(ADK_TARGET_LIBC_PATH
) && \
42 ln
-sf libc.so
$(MUSL_LD_SO
))
43 (cd
$(IDIR_MUSL
)/bin
&& \
44 ln
-sf ..
/lib
/$(MUSL_LD_SO
) ldd
)
49 ${INSTALL_DIR} ${IDIR_MUSL_DEV}/usr
/lib
50 ${CP} ${STAGING_TARGET_DIR}/usr
/lib
/crt
*.o
${IDIR_MUSL_DEV}/usr
/lib
52 $(MAKE
) -C
$(TOOLCHAIN_BUILD_DIR
)/w-linux-
$(KERNEL_VERSION
)/linux-
$(KERNEL_FILE_VER
) \
54 INSTALL_HDR_PATH
=$(IDIR_MUSL_DEV
)/usr \
56 $(MAKE
) -C
$(TOOLCHAIN_BUILD_DIR
)/w-
$(PKG_NAME
)-$(PKG_VERSION
)-$(PKG_RELEASE
)/${PKG_NAME}-${PKG_VERSION} \
57 DESTDIR
=$(IDIR_MUSL_DEV
) \
59 @find
$(IDIR_MUSL_DEV
) -name .
install -exec
rm {} \
;
60 @find
$(IDIR_MUSL_DEV
) -name ..
install.cmd
-exec
rm {} \
;
62 include ${ADK_TOPDIR}/mk
/pkg-bottom.mk