update lua to latest stable version
[openadk.git] / package / musl / Makefile
blob76ad8690f89af959f22c8234fc29ad45e20b3ef7
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/kernel-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 MARCH:= $(ADK_TARGET_CPU_ARCH)
30 ifeq ($(ADK_TARGET_CPU_ARCH),i686)
31 MARCH:= i386
32 endif
33 ifeq ($(ADK_TARGET_CPU_ARCH),i586)
34 MARCH:= i386
35 endif
36 ifeq ($(ADK_TARGET_CPU_ARCH),i486)
37 MARCH:= i386
38 endif
39 ifeq ($(ADK_TARGET_CPU_ARCH),ppc)
40 MARCH:= powerpc
41 endif
42 ifeq ($(ADK_TARGET_CPU_ARCH),sh4)
43 MARCH:= sh
44 endif
45 ifeq ($(ADK_TARGET_CPU_ARCH),sh4eb)
46 MARCH:= sheb
47 endif
48 ifeq ($(ADK_TARGET_ARCH_ARM),y)
49 ifeq ($(ADK_TARGET_ABI),eabihf)
50 MARCH:= armhf
51 endif
52 endif
53 ifeq ($(ADK_TARGET_ABI_X32),y)
54 MARCH:= x32
55 endif
57 # do nothing, musl is already build in toolchain directory
58 do-install:
59 ifneq ($(ADK_TARGET_USE_STATIC_LIBS),y)
60 ${INSTALL_DIR} $(IDIR_MUSL)/bin
61 ${INSTALL_DIR} $(IDIR_MUSL)/$(ADK_TARGET_LIBC_PATH)
62 $(CP) $(STAGING_TARGET_DIR)/usr/lib/libc.so $(IDIR_MUSL)/$(ADK_TARGET_LIBC_PATH)
63 (cd $(IDIR_MUSL)/$(ADK_TARGET_LIBC_PATH) && \
64 ln -sf libc.so ld-musl-$(MARCH).so.1)
65 (cd $(IDIR_MUSL)/bin && \
66 ln -sf ../lib/ld-musl-$(MARCH).so.1 ldd)
67 endif
70 musl-dev-install:
71 ${INSTALL_DIR} ${IDIR_MUSL_DEV}/usr/lib
72 ${CP} ${STAGING_TARGET_DIR}/usr/lib/crt*.o ${IDIR_MUSL_DEV}/usr/lib
73 ${KERNEL_MAKE_ENV} \
74 $(MAKE) -C $(TOOLCHAIN_BUILD_DIR)/w-linux-$(KERNEL_VERSION)-$(KERNEL_RELEASE)/linux-$(KERNEL_VERSION) \
75 $(KERNEL_MAKE_OPTS) \
76 INSTALL_HDR_PATH=$(IDIR_MUSL_DEV)/usr \
77 headers_install
78 $(MAKE) -C $(TOOLCHAIN_BUILD_DIR)/w-$(PKG_NAME)-$(PKG_VERSION)-$(PKG_RELEASE)/${PKG_NAME}-${PKG_VERSION} \
79 DESTDIR=$(IDIR_MUSL_DEV) \
80 install-headers
81 @find $(IDIR_MUSL_DEV) -name .install -exec rm {} \;
82 @find $(IDIR_MUSL_DEV) -name ..install.cmd -exec rm {} \;
84 include ${ADK_TOPDIR}/mk/pkg-bottom.mk