Makefile 2.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. #
  2. # Copyright (C) 2015 OpenWrt.org
  3. #
  4. # This is free software, licensed under the GNU General Public License v2.
  5. # See /LICENSE for more information.
  6. #
  7. include $(TOPDIR)/rules.mk
  8. PKG_NAME:=libupm
  9. PKG_VERSION:=0.4.0
  10. PKG_RELEASE=$(PKG_SOURCE_VERSION)
  11. PKG_SOURCE_PROTO:=git
  12. PKG_SOURCE_URL:=https://github.com/intel-iot-devkit/upm.git
  13. PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
  14. PKG_SOURCE_VERSION:=04dc6df4297a7766d6f1a8fef9699d586e7e0d92
  15. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
  16. CMAKE_INSTALL:=1
  17. PKG_MAINTAINER:=John Crispin <blogic@openwrt.org>
  18. PKG_LICENSE:=LGPL-2.1
  19. include $(INCLUDE_DIR)/package.mk
  20. include $(INCLUDE_DIR)/cmake.mk
  21. UPM_MODULES:= \
  22. a110x ad8232 adafruitss adc121c021 adis16448 adxl335 adxl345 am2315 apds9002 at42qt1070 biss0001 bmpx8x buzzer \
  23. cjq4435 ds1307 ecs1030 enc03r flex gas gp2y0a grovecircularled grovecollision groveehr groveeldriver groveelectromagnet \
  24. groveemg grovegprs grovegsr grovelinefinder grovemd grovemoisture groveo2 grovescam grove grovespeaker grovevdiv grovewater \
  25. grovewfs guvas12d h3lis331dl hcsr04 hm11 hmc5883l hmtrp hp20x ht9170 htu21d hx711 i2clcd ina132 isd1820 itg3200 joystick12 \
  26. l298 ldt0028 lm35 lol loudness lpd8806 lsm303 lsm9ds0 m24lr64e max31723 max31855 max44000 max5487 maxds3231m maxsonarez \
  27. mg811 mhz16 mic mlx90614 mma7455 mma7660 mpl3115a2 mpr121 mpu9150 mq303a my9221 nrf24l01 nrf8001 nunchuck otp538u \
  28. pn532 ppd42ns pulsensor rfr359f rgbringcoder rotaryencoder rpr220 servo si114x sm130 st7735 stepmotor sx6119 ta12200 tcs3414cs \
  29. th02 tm1637 tsl2561 ttp223 ublox6 uln200xa waterlevel wheelencoder wt5001 yg1006 zfm20
  30. CMAKE_OPTIONS=-DBUILDARCH=$(CONFIG_ARCH) \
  31. -DNODE_EXECUTABLE=$(STAGING_DIR_HOSTPKG)/bin/node \
  32. -DSWIG_DIR=$(STAGING_DIR_HOSTPKG)/bin
  33. define Package/libupm/Default
  34. SECTION:=libs
  35. CATEGORY:=Libraries
  36. DEPENDS:=+libmraa +librt
  37. SUBMENU:=IoT
  38. endef
  39. define Package/libupm
  40. $(call Package/libupm/Default)
  41. TITLE:=Intel IoT sensor library - Full
  42. endef
  43. define Package/libupm/install/Default
  44. $(INSTALL_DIR) $(1)/usr/lib/{node/,python2.7/site-packages}; \
  45. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libupm-$(2).so* $(1)/usr/lib/; \
  46. $(CP) $(PKG_INSTALL_DIR)/usr/lib/node_modules/jsupm_$(2) $(1)/usr/lib/node/; \
  47. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/python2.7/site-packages/{pyupm_$(2).py,_pyupm_$(2).so} \
  48. $(1)/usr/lib/python2.7/site-packages/ ;
  49. endef
  50. define Package/libupm/install
  51. $(foreach module, $(UPM_MODULES), \
  52. $(call Package/libupm/install/Default,$(1),$(module)))
  53. endef
  54. define UpmPackage
  55. define Package/libupm-$(1)
  56. $(call Package/libupm/Default)
  57. TITLE:=Intel IoT sensor library - $(1)
  58. endef
  59. define Package/libupm-$(1)/install
  60. $(call Package/libupm/install/Default,$$(1),$(1))
  61. endef
  62. endef
  63. $(eval $(call BuildPackage,libupm))
  64. $(foreach package, $(UPM_MODULES), \
  65. $(eval $(call UpmPackage,$(package))) \
  66. $(eval $(call BuildPackage,libupm-$(package))) \
  67. )