Makefile 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. PATH_PREFIX=.
  2. include ./common.mk
  3. HOST_STAMP_BUILT:=$(HOST_BUILD_DIR)/.built
  4. HOST_STAMP_INSTALLED:=$(TOOLCHAIN_DIR)/stamp/.uclibc_installed
  5. HOST_BUILD_PARALLEL:=1
  6. define Host/SetToolchainInfo
  7. $(SED) 's,^\(LIBC_TYPE\)=.*,\1=$(PKG_NAME),' $(TOOLCHAIN_DIR)/info.mk
  8. $(SED) 's,^\(LIBC_URL\)=.*,\1=http://www.uclibc.org/,' $(TOOLCHAIN_DIR)/info.mk
  9. $(SED) 's,^\(LIBC_VERSION\)=.*,\1=$(PKG_VERSION),' $(TOOLCHAIN_DIR)/info.mk
  10. $(SED) 's,^\(LIBC_SO_VERSION\)=.*,\1=$(LIBC_SO_VERSION),' $(TOOLCHAIN_DIR)/info.mk
  11. endef
  12. define Host/Compile
  13. $(SED) 's,^CROSS=.*,CROSS=$(TARGET_CROSS),g' $(HOST_BUILD_DIR)/Rules.mak
  14. $(UCLIBC_MAKE) PREFIX= all
  15. endef
  16. define Host/Install
  17. $(call Host/SetToolchainInfo)
  18. $(UCLIBC_MAKE) PREFIX="$(TOOLCHAIN_DIR)/" install_runtime install_dev
  19. $(CP) $(HOST_BUILD_DIR)/libc/libc_so.a $(TOOLCHAIN_DIR)/lib/
  20. $(CP) $(HOST_BUILD_DIR)/libpthread/*/libpthread_so.a $(TOOLCHAIN_DIR)/lib/
  21. ( cd $(TOOLCHAIN_DIR) ; \
  22. for d in lib usr/lib ; do \
  23. for f in libc.so libpthread.so libgcc_s.so ; do \
  24. if [ -f $$$$d/$$$$f -a ! -L $$$$d/$$$$f ] ; then \
  25. $(SED) 's,/usr/lib/,,g;s,/lib/,,g' $$$$d/$$$$f ; \
  26. fi \
  27. done \
  28. done \
  29. )
  30. rm -f \
  31. $(TOOLCHAIN_DIR)/lib/libresolv*.so* \
  32. $(TOOLCHAIN_DIR)/lib/libnsl*.so*
  33. endef
  34. $(eval $(call HostBuild))