Makefile 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. #
  2. # Copyright (C) 2010-2012 OpenWrt.org
  3. #
  4. # This Makefile and the code shipped in src/ is free software, licensed
  5. # under the GNU Lesser General Public License, version 2.1 and later.
  6. # See src/COPYING for more information.
  7. #
  8. # Refer to src/COPYRIGHT for copyright statements on the source files.
  9. #
  10. include $(TOPDIR)/rules.mk
  11. PKG_NAME:=libiconv
  12. PKG_RELEASE:=8
  13. PKG_LICENSE:=LGPL-2.1
  14. PKG_LICENSE_FILES:=LICENSE
  15. PKG_MAINTAINER:=Jo-Philipp Wich <jo@mein.io>
  16. include $(INCLUDE_DIR)/package.mk
  17. include $(INCLUDE_DIR)/host-build.mk
  18. define Package/libiconv
  19. SECTION:=libs
  20. CATEGORY:=Libraries
  21. TITLE:=Tiny drop-in replacement for the GNU Character set conversion library
  22. endef
  23. define Build/Configure
  24. endef
  25. define Build/Compile
  26. $(TARGET_CC) $(TARGET_CFLAGS) -c $(PKG_BUILD_DIR)/iconv.c -o $(PKG_BUILD_DIR)/iconv.o -I$(PKG_BUILD_DIR)/include $(FPIC)
  27. $(TARGET_CROSS)ar rcs $(PKG_BUILD_DIR)/libiconv.a $(PKG_BUILD_DIR)/iconv.o
  28. endef
  29. define Build/InstallDev
  30. $(INSTALL_DIR) $(1)/usr/lib/libiconv-stub/lib
  31. $(INSTALL_DATA) $(PKG_BUILD_DIR)/libiconv.a $(1)/usr/lib/libiconv-stub/lib/
  32. $(INSTALL_DIR) $(1)/usr/lib/libiconv-stub/include
  33. $(INSTALL_DATA) $(PKG_BUILD_DIR)/include/iconv.h $(1)/usr/lib/libiconv-stub/include/
  34. $(INSTALL_DIR) $(1)/usr/share/aclocal
  35. $(INSTALL_DATA) $(PKG_BUILD_DIR)/m4/* $(1)/usr/share/aclocal/
  36. endef
  37. define Package/libiconv/install
  38. $(INSTALL_DIR) $(1)/tmp
  39. touch $(1)/tmp/.libiconv-placeholder
  40. endef
  41. define Host/Prepare
  42. mkdir -p $(HOST_BUILD_DIR)
  43. endef
  44. define Host/Configure
  45. endef
  46. define Host/Compile
  47. $(HOSTCC) -c src/iconv.c -o $(HOST_BUILD_DIR)/iconv.o -Isrc/include -fPIC
  48. ar rcs $(HOST_BUILD_DIR)/libiconv.a $(HOST_BUILD_DIR)/iconv.o
  49. endef
  50. define Host/Install
  51. $(INSTALL_DIR) $(STAGING_DIR_HOSTPKG)/lib
  52. $(INSTALL_DATA) $(HOST_BUILD_DIR)/libiconv.a $(STAGING_DIR_HOSTPKG)/lib/
  53. $(INSTALL_DIR) $(STAGING_DIR_HOSTPKG)/include
  54. $(INSTALL_DATA) ./src/include/iconv.h $(STAGING_DIR_HOSTPKG)/include/
  55. $(INSTALL_DIR) $(STAGING_DIR_HOSTPKG)/share/aclocal
  56. $(INSTALL_DATA) ./src/m4/* $(STAGING_DIR_HOSTPKG)/share/aclocal/
  57. endef
  58. $(eval $(call HostBuild))
  59. $(eval $(call BuildPackage,libiconv))