gzip: update to 1.10
[openadk.git] / package / musl / Makefile
blobba31e1f5fe57028680d61c714d5a55489d892779
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
9 PKG_NAME:= musl
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
18 NO_DISTFILES:= 1
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}))
25 CONFIG_STYLE:= manual
26 BUILD_STYLE:= manual
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
36 do-install:
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)
45 endif
48 musl-dev-install:
49 ${INSTALL_DIR} ${IDIR_MUSL_DEV}/usr/lib
50 ${CP} ${STAGING_TARGET_DIR}/usr/lib/crt*.o ${IDIR_MUSL_DEV}/usr/lib
51 ${KERNEL_MAKE_ENV} \
52 $(MAKE) -C $(TOOLCHAIN_BUILD_DIR)/w-linux-$(KERNEL_VERSION)/linux-$(KERNEL_FILE_VER) \
53 $(KERNEL_MAKE_OPTS) \
54 INSTALL_HDR_PATH=$(IDIR_MUSL_DEV)/usr \
55 headers_install
56 $(MAKE) -C $(TOOLCHAIN_BUILD_DIR)/w-$(PKG_NAME)-$(PKG_VERSION)-$(PKG_RELEASE)/${PKG_NAME}-${PKG_VERSION} \
57 DESTDIR=$(IDIR_MUSL_DEV) \
58 install-headers
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