#
# Sirui Zhao@mediatek.com
#
# MTK Property Software.
#

include $(TOPDIR)/rules.mk

PKG_NAME:=air_monitor
PKG_REVISION:=be424fa9
PKG_SOURCE:=$(PKG_NAME)-$(PKG_REVISION).tar.bz2
PKG_RELEASE:=1

PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)
PKG_KCONFIG:=


include $(INCLUDE_DIR)/package.mk
include $(INCLUDE_DIR)/kernel.mk

define Package/air_monitor
  SECTION:=MTK Properties
  CATEGORY:=MTK Properties
  TITLE:=Air Monitor Daemon
  SUBMENU:=Applications
endef

define Package/air_monitor/description
  This is a sample daemon for test and verify function for Air Monitor in Driver.
endef

ifeq ($(MTK_RELEASE_VERSION),trunk)
USE_SOURCE_DIR:=$(MTK_WLAN_APP_DIR)/air_monitor
define Build/Prepare
	rm -rf $(PKG_BUILD_DIR)
	$(if $(wildcard $(USE_SOURCE_DIR)/*),,@echo "Error: USE_SOURCE_DIR=$(USE_SOURCE_DIR) path not found"; false)
	cp -rf $(USE_SOURCE_DIR) $(PKG_BUILD_DIR)
	rm -rf $(PKG_BUILD_DIR)/.git
	$(Build/Patch)
	touch $(PKG_BUILD_DIR)/.source_dir
	touch $(PKG_BUILD_DIR)/.no_autorebuild
endef
endif


#TARGET_CFLAGS += \
#	CFLAGS="$(TARGET_CFLAGS)"

define Build/Configure
endef

define Package/air_monitor/install
	$(INSTALL_DIR) $(1)/bin
	$(INSTALL_BIN) $(PKG_BUILD_DIR)/AirMonitorApp $(1)/bin/air_monitor
endef


$(eval $(call BuildPackage,air_monitor))

