Makefile 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  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:=7
  13. PKG_LICENSE:=LGPL-2.1
  14. PKG_LICENSE_FILES:=LICENSE
  15. PKG_MAINTAINER:=Jo-Philipp Wich <jow@openwrt.org>
  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/Prepare
  24. $(INSTALL_DIR) $(PKG_BUILD_DIR)
  25. $(CP) ./src/* $(PKG_BUILD_DIR)/
  26. endef
  27. define Build/Configure
  28. endef
  29. define Build/Compile
  30. $(TARGET_CC) $(TARGET_CFLAGS) -c $(PKG_BUILD_DIR)/iconv.c -o $(PKG_BUILD_DIR)/iconv.o -I$(PKG_BUILD_DIR)/include $(FPIC)
  31. $(TARGET_CROSS)ar rcs $(PKG_BUILD_DIR)/libiconv.a $(PKG_BUILD_DIR)/iconv.o
  32. endef
  33. define Build/InstallDev
  34. $(INSTALL_DIR) $(1)/usr/lib/libiconv-stub/lib
  35. $(INSTALL_DATA) $(PKG_BUILD_DIR)/libiconv.a $(1)/usr/lib/libiconv-stub/lib/
  36. $(INSTALL_DIR) $(1)/usr/lib/libiconv-stub/include
  37. $(INSTALL_DATA) $(PKG_BUILD_DIR)/include/iconv.h $(1)/usr/lib/libiconv-stub/include/
  38. $(INSTALL_DIR) $(1)/usr/share/aclocal
  39. $(INSTALL_DATA) $(PKG_BUILD_DIR)/m4/* $(1)/usr/share/aclocal/
  40. endef
  41. define Package/libiconv/install
  42. $(INSTALL_DIR) $(1)/tmp
  43. touch $(1)/tmp/.libiconv-placeholder
  44. endef
  45. define Host/Prepare
  46. mkdir -p $(HOST_BUILD_DIR)
  47. endef
  48. define Host/Configure
  49. endef
  50. define Host/Compile
  51. $(HOSTCC) -c src/iconv.c -o $(HOST_BUILD_DIR)/iconv.o -Isrc/include -fPIC
  52. ar rcs $(HOST_BUILD_DIR)/libiconv.a $(HOST_BUILD_DIR)/iconv.o
  53. endef
  54. define Host/Install
  55. $(INSTALL_DIR) $(STAGING_DIR_HOST)/lib
  56. $(INSTALL_DATA) $(HOST_BUILD_DIR)/libiconv.a $(STAGING_DIR_HOST)/lib/
  57. $(INSTALL_DIR) $(STAGING_DIR_HOST)/include
  58. $(INSTALL_DATA) ./src/include/iconv.h $(STAGING_DIR_HOST)/include/
  59. $(INSTALL_DIR) $(STAGING_DIR_HOST)/share/aclocal
  60. $(INSTALL_DATA) ./src/m4/* $(STAGING_DIR_HOST)/share/aclocal/
  61. endef
  62. $(eval $(call HostBuild))
  63. $(eval $(call BuildPackage,libiconv))