musl: fix mips vdso handling
[openwrt/staging/chunkeey.git] / toolchain / musl / Makefile
1 PATH_PREFIX=.
2
3 include ./common.mk
4
5 HOST_STAMP_BUILT:=$(HOST_BUILD_DIR)/.built
6 HOST_STAMP_INSTALLED:=$(TOOLCHAIN_DIR)/stamp/.musl_installed
7
8 HOST_BUILD_PARALLEL:=1
9
10 MUSL_MAKEOPTS = -C $(HOST_BUILD_DIR) \
11 DESTDIR="$(TOOLCHAIN_DIR)/" \
12 LIBCC="$(subst libgcc.a,libgcc_initial.a,$(shell $(TARGET_CC) -print-libgcc-file-name))"
13
14 define Host/SetToolchainInfo
15 $(SED) 's,^\(LIBC_TYPE\)=.*,\1=$(PKG_NAME),' $(TOOLCHAIN_DIR)/info.mk
16 $(SED) 's,^\(LIBC_URL\)=.*,\1=http://www.musl-libc.org/,' $(TOOLCHAIN_DIR)/info.mk
17 $(SED) 's,^\(LIBC_VERSION\)=.*,\1=$(PKG_VERSION),' $(TOOLCHAIN_DIR)/info.mk
18 $(SED) 's,^\(LIBC_SO_VERSION\)=.*,\1=$(LIBC_SO_VERSION),' $(TOOLCHAIN_DIR)/info.mk
19 endef
20
21 define Host/Compile
22 +$(MAKE) $(HOST_JOBS) $(MUSL_MAKEOPTS) all
23 endef
24
25 define Host/Install
26 $(call Host/SetToolchainInfo)
27 $(MAKE) $(MUSL_MAKEOPTS) DESTDIR="$(TOOLCHAIN_DIR)/" install
28 $(CP) ./include $(TOOLCHAIN_DIR)/
29 endef
30
31 $(eval $(call HostBuild))