1
0

Makefile 930 B

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