iopsys-feed/peripheral_manager/Makefile
2020-06-30 10:54:13 +02:00

71 lines
2 KiB
Makefile

#
# Copyright (C) 2019 iopsys
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
include $(TOPDIR)/rules.mk
include $(INCLUDE_DIR)/kernel.mk
PKG_NAME:=peripheral_manager
PKG_VERSION:=1.0.5
PKG_RELEASE:=1
PKG_SOURCE_VERSION:=0513e171013512bc14ef8b650c715e3fd9c59820
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/peripheral-manager
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_RELEASE)-$(PKG_SOURCE_VERSION).tar.gz
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
PKG_LICENSE:=GPLv2
PKG_LICENSE_FILES:=LICENSE
# support parallel build
PKG_BUILD_PARALLEL:=1
# run install target when cross compiling. basically, make install DESTDIR=$(PKG_INSTALL_DIR)
# this way we don't need to pick out the resulting files from the build dir.
PKG_INSTALL:=1
include $(INCLUDE_DIR)/package.mk
include $(INCLUDE_DIR)/cmake.mk
define Package/peripheral_manager
CATEGORY:=Utilities
TITLE:=Application deamon for handling of peripheral
URL:=
DEPENDS:=+libuci +libubus +libblobmsg-json @+PACKAGE_bcmkernel:bcmkernel PACKAGE_bcmkernel:bcmkernel
endef
define Package/peripheral_manager/description
Application handling peripheral
endef
TARGET_CFLAGS := \
-I$(STAGING_DIR)/usr/include/bcm963xx/shared/opensource/include/bcm963xx \
-I$(STAGING_DIR)/usr/include/bcm963xx/bcmdrivers/opensource/include/bcm963xx \
$(TARGET_CFLAGS)
PERIPHERAL_OPTONS:=-DSELECT_BRCM_BOARD=0
ifneq ($(CONFIG_TARGET_iopsys_brcm63xx_arm)$(CONFIG_TARGET_iopsys_brcm63xx_mips),)
PERIPHERAL_OPTONS:= -DSELECT_BRCM_BOARD=1
endif
CMAKE_OPTIONS += \
-DCMAKE_BUILD_TYPE:String="Release" \
$(PERIPHERAL_OPTONS) \
define Package/peripheral_manager/install
$(CP) ./files/* $(1)/
$(INSTALL_DIR) $(1)/etc/
$(INSTALL_DIR) $(1)/etc/init.d/
$(INSTALL_DIR) $(1)/sbin
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/peripheral_manager $(1)/sbin/
# $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/gpio_test $(1)/sbin/
endef
$(eval $(call BuildPackage,peripheral_manager))