377 lines
9.6 KiB
Makefile
377 lines
9.6 KiB
Makefile
|
##############################################
|
||
|
# OpenWrt Makefile for smartlinkd program
|
||
|
#
|
||
|
#
|
||
|
# Most of the variables used here are defined in
|
||
|
# the include directives below. We just need to
|
||
|
# specify a basic description of the package,
|
||
|
# where to build our program, where to find
|
||
|
# the source files, and where to install the
|
||
|
# compiled program on the router.
|
||
|
#
|
||
|
# Be very careful of spacing in this file.
|
||
|
# Indents should be tabs, not spaces, and
|
||
|
# there should be no trailing whitespace in
|
||
|
# lines that are not commented.
|
||
|
#
|
||
|
##############################################
|
||
|
include $(TOPDIR)/rules.mk
|
||
|
include $(BUILD_DIR)/kernel.mk
|
||
|
|
||
|
# Name and release number of this package
|
||
|
PKG_NAME:=smartlinkd
|
||
|
PKG_VERSION:=0.2.1
|
||
|
PKG_RELEASE:=1
|
||
|
|
||
|
PKG_BUILD_DIR := $(COMPILE_DIR)/$(PKG_NAME)
|
||
|
|
||
|
ifeq ($(TARGET_CPU_VARIANT),arm926ej-s)
|
||
|
ARCH=arm926ej-s
|
||
|
endif
|
||
|
|
||
|
include $(BUILD_DIR)/package.mk
|
||
|
|
||
|
define Package/$(PKG_NAME)/Default
|
||
|
SECTION:=utils
|
||
|
CATEGORY:=Allwinner
|
||
|
DEPENDS:=+libpthread +libstdcpp +liballwinner-base +alsa-lib +wifimanager +libopenssl +libuci
|
||
|
endef
|
||
|
|
||
|
define Package/$(PKG_NAME)
|
||
|
$(call Package/$(PKG_NAME)/Default)
|
||
|
TITLE:=smartlink
|
||
|
MENU:=1
|
||
|
endef
|
||
|
|
||
|
define Package/$(PKG_NAME)-demo
|
||
|
$(call Package/$(PKG_NAME)/Default)
|
||
|
TITLE:=smartlinkd demo
|
||
|
DEPENDS:=$(PKG_NAME)
|
||
|
endef
|
||
|
|
||
|
define Package/$(PKG_NAME)-setup
|
||
|
$(call Package/$(PKG_NAME)/Default)
|
||
|
TITLE:=smartlinkd_setup
|
||
|
DEPENDS:=$(PKG_NAME) @PACKAGE_kmod-net-broadcom
|
||
|
endef
|
||
|
|
||
|
define Package/$(PKG_NAME)-soundwave
|
||
|
$(call Package/$(PKG_NAME)/Default)
|
||
|
TITLE:= smartlinkd_soundwave demo
|
||
|
DEPENDS:=$(PKG_NAME)
|
||
|
endef
|
||
|
|
||
|
define Package/$(PKG_NAME)-softAP
|
||
|
$(call Package/$(PKG_NAME)/Default)
|
||
|
TITLE:= smartlinkd_softAP demo
|
||
|
DEPENDS:=$(PKG_NAME) +softap +softap-demo @PACKAGE_kmod-net-broadcom
|
||
|
endef
|
||
|
|
||
|
define Package/$(PKG_NAME)-xrconfig
|
||
|
$(call Package/$(PKG_NAME)/Default)
|
||
|
TITLE:= xr819 smartconfig demo +iw
|
||
|
DEPENDS:=$(PKG_NAME) @PACKAGE_kmod-xradio-xr819
|
||
|
endef
|
||
|
|
||
|
define Package/$(PKG_NAME)-xrairkiss
|
||
|
$(call Package/$(PKG_NAME)/Default)
|
||
|
TITLE:= xr819 airkiss demo
|
||
|
DEPENDS:=$(PKG_NAME) @PACKAGE_kmod-xradio-xr819 +iw
|
||
|
endef
|
||
|
|
||
|
#dhd_priv ,add by Kirin
|
||
|
define Package/$(PKG_NAME)-dhd_priv
|
||
|
$(call Package/$(PKG_NAME)/Default)
|
||
|
TITLE:=dhd_priv
|
||
|
DEPENDS:=$(PKG_NAME) @PACKAGE_kmod-net-broadcom
|
||
|
endef
|
||
|
|
||
|
#smartlink_raw ,add by Kirin
|
||
|
define Package/$(PKG_NAME)-raw
|
||
|
$(call Package/$(PKG_NAME)/Default)
|
||
|
TITLE:=smartlink_raw
|
||
|
DEPENDS:=$(PKG_NAME) @PACKAGE_kmod-net-broadcom
|
||
|
endef
|
||
|
|
||
|
define Package/$(PKG_NAME)/description
|
||
|
wifi configuration for none input platform
|
||
|
endef
|
||
|
|
||
|
define Package/$(PKG_NAME)-demo/description
|
||
|
client demo
|
||
|
endef
|
||
|
|
||
|
define Package/$(PKG_NAME)-soundwave/description
|
||
|
soundwave demo
|
||
|
endef
|
||
|
|
||
|
define Package/$(PKG_NAME)-setup/description
|
||
|
broadcom setup demo
|
||
|
endef
|
||
|
|
||
|
define Package/$(PKG_NAME)-softAP/description
|
||
|
softap demo
|
||
|
endef
|
||
|
|
||
|
#dhd_priv demo,add by Kirin
|
||
|
define Package/$(PKG_NAME)-dhd_priv/description
|
||
|
dhd_priv demo
|
||
|
endef
|
||
|
|
||
|
#smartlink_raw demo,add by Kirin
|
||
|
define Package/$(PKG_NAME)-raw/description
|
||
|
smartlink_raw demo
|
||
|
endef
|
||
|
|
||
|
define Package/$(PKG_NAME)-xrconfig/description
|
||
|
xr819 smartconfig demo
|
||
|
endef
|
||
|
|
||
|
define Package/$(PKG_NAME)-xrairkiss/description
|
||
|
xr819 xrairkiss demo
|
||
|
endef
|
||
|
|
||
|
define Build/Prepare
|
||
|
mkdir -p $(PKG_BUILD_DIR)/
|
||
|
$(CP) -r ./src $(PKG_BUILD_DIR)/
|
||
|
$(CP) -r ./demo $(PKG_BUILD_DIR)/
|
||
|
endef
|
||
|
|
||
|
define Build/Compile/$(PKG_NAME)
|
||
|
#compile libs and service
|
||
|
$(MAKE) -C $(PKG_BUILD_DIR)/src \
|
||
|
MAKE="$(MAKE)" \
|
||
|
ARCH="$(TARGET_ARCH)" \
|
||
|
AR="$(TARGET_AR)" \
|
||
|
CC="$(TARGET_CC)" \
|
||
|
CXX="$(TARGET_CXX)" \
|
||
|
CFLAGS="$(TARGET_CFLAGS)"\
|
||
|
LDFLAGS="$(TARGET_LDFLAGS)" \
|
||
|
CONFIG_PREFIX="$(PKG_INSTALL_DIR)" \
|
||
|
SAVE_DIR="`pwd`" \
|
||
|
CONFIG_LIBC="$(CONFIG_LIBC)" \
|
||
|
all
|
||
|
endef
|
||
|
|
||
|
ifeq ($(CONFIG_PACKAGE_smartlinkd-demo),y)
|
||
|
define Build/Compile/$(PKG_NAME)-demo
|
||
|
#compile demo
|
||
|
$(MAKE) -C $(PKG_BUILD_DIR)/demo \
|
||
|
MAKE="$(MAKE)" \
|
||
|
ARCH="$(TARGET_ARCH)" \
|
||
|
AR="$(TARGET_AR)" \
|
||
|
CC="$(TARGET_CC)" \
|
||
|
CXX="$(TARGET_CXX)" \
|
||
|
CFLAGS="$(TARGET_CFLAGS)"\
|
||
|
LDFLAGS="$(TARGET_LDFLAGS)" \
|
||
|
CONFIG_PREFIX="$(PKG_INSTALL_DIR)" \
|
||
|
all
|
||
|
endef
|
||
|
endif
|
||
|
|
||
|
ifeq ($(CONFIG_PACKAGE_smartlinkd-setup),y)
|
||
|
define Build/Compile/$(PKG_NAME)-setup
|
||
|
#compile broadcom_setup
|
||
|
$(MAKE) -C $(PKG_BUILD_DIR)/src/source/broadcom/EasySetupTarget/jni \
|
||
|
MAKE="$(MAKE)" \
|
||
|
ARCH="$(TARGET_ARCH)" \
|
||
|
AR="$(TARGET_AR)" \
|
||
|
CC="$(TARGET_CC)" \
|
||
|
CXX="$(TARGET_CXX)" \
|
||
|
CFLAGS="$(TARGET_CFLAGS)"\
|
||
|
LDFLAGS="$(TARGET_LDFLAGS)" \
|
||
|
CONFIG_PREFIX="$(PKG_INSTALL_DIR)" \
|
||
|
all
|
||
|
endef
|
||
|
endif
|
||
|
|
||
|
ifeq ($(CONFIG_PACKAGE_smartlinkd-dhd_priv),y)
|
||
|
define Build/Compile/$(PKG_NAME)-dhd_priv
|
||
|
#compile dhd_priv
|
||
|
$(MAKE) -C $(PKG_BUILD_DIR)/src/source/broadcom/dhd_priv \
|
||
|
MAKE="$(MAKE)" \
|
||
|
ARCH="$(TARGET_ARCH)" \
|
||
|
AR="$(TARGET_AR)" \
|
||
|
CC="$(TARGET_CC)" \
|
||
|
CXX="$(TARGET_CXX)" \
|
||
|
CFLAGS="$(TARGET_CFLAGS)"\
|
||
|
LDFLAGS="$(TARGET_LDFLAGS)" \
|
||
|
CONFIG_PREFIX="$(PKG_INSTALL_DIR)" \
|
||
|
all
|
||
|
endef
|
||
|
endif
|
||
|
|
||
|
ifeq ($(CONFIG_PACKAGE_smartlinkd-raw),y)
|
||
|
define Build/Compile/$(PKG_NAME)-raw
|
||
|
#compile smartlink_raw
|
||
|
$(MAKE) -C $(PKG_BUILD_DIR)/src/source/broadcom/raw \
|
||
|
MAKE="$(MAKE)" \
|
||
|
ARCH="$(TARGET_ARCH)" \
|
||
|
AR="$(TARGET_AR)" \
|
||
|
CC="$(TARGET_CC)" \
|
||
|
CXX="$(TARGET_CXX)" \
|
||
|
CFLAGS="$(TARGET_CFLAGS)"\
|
||
|
LDFLAGS="$(TARGET_LDFLAGS)" \
|
||
|
CONFIG_PREFIX="$(PKG_INSTALL_DIR)" \
|
||
|
all
|
||
|
endef
|
||
|
endif
|
||
|
|
||
|
ifeq ($(CONFIG_PACKAGE_smartlinkd-xrconfig),y)
|
||
|
define Build/Compile/$(PKG_NAME)-xrconfig
|
||
|
#compile xr819 smartconfig
|
||
|
$(MAKE) -C $(PKG_BUILD_DIR)/src/source/xr819/smartconfig \
|
||
|
MAKE="$(MAKE)" \
|
||
|
ARCH="$(TARGET_ARCH)" \
|
||
|
AR="$(TARGET_AR)" \
|
||
|
CC="$(TARGET_CC)" \
|
||
|
CXX="$(TARGET_CXX)" \
|
||
|
CFLAGS="$(TARGET_CFLAGS)"\
|
||
|
LDFLAGS="$(TARGET_LDFLAGS)" \
|
||
|
CONFIG_LIBC="$(CONFIG_LIBC)" \
|
||
|
CPU="$(ARCH)" \
|
||
|
CONFIG_PREFIX="$(PKG_INSTALL_DIR)" \
|
||
|
all
|
||
|
|
||
|
endef
|
||
|
endif
|
||
|
|
||
|
ifeq ($(CONFIG_PACKAGE_smartlinkd-xrairkiss),y)
|
||
|
define Build/Compile/$(PKG_NAME)-xrairkiss
|
||
|
#compile xr819 airkiss
|
||
|
$(MAKE) -C $(PKG_BUILD_DIR)/src/source/xr819/airkiss \
|
||
|
MAKE="$(MAKE)" \
|
||
|
ARCH="$(TARGET_ARCH)" \
|
||
|
AR="$(TARGET_AR)" \
|
||
|
CC="$(TARGET_CC)" \
|
||
|
CXX="$(TARGET_CXX)" \
|
||
|
CFLAGS="$(TARGET_CFLAGS)"\
|
||
|
LDFLAGS="$(TARGET_LDFLAGS)" \
|
||
|
CONFIG_LIBC="$(CONFIG_LIBC)" \
|
||
|
CPU="$(ARCH)" \
|
||
|
CONFIG_PREFIX="$(PKG_INSTALL_DIR)" \
|
||
|
all
|
||
|
|
||
|
endef
|
||
|
endif
|
||
|
|
||
|
ifeq ($(CONFIG_PACKAGE_smartlinkd-softAP),y)
|
||
|
define Build/Compile/$(PKG_NAME)-softAP
|
||
|
#compile softAP demo
|
||
|
$(MAKE) -C $(PKG_BUILD_DIR)/src/source/softAP \
|
||
|
MAKE="$(MAKE)" \
|
||
|
ARCH="$(TARGET_ARCH)" \
|
||
|
AR="$(TARGET_AR)" \
|
||
|
CC="$(TARGET_CC)" \
|
||
|
CXX="$(TARGET_CXX)" \
|
||
|
CFLAGS="$(TARGET_CFLAGS)" \
|
||
|
LDFLAGS="$(TARGET_LDFLAGS)" \
|
||
|
CONFIG_PREFIX="$(PKG_INSTALL_DIR)" \
|
||
|
all
|
||
|
endef
|
||
|
endif
|
||
|
|
||
|
ifeq ($(CONFIG_PACKAGE_smartlinkd-soundwave),y)
|
||
|
define Build/Compile/$(PKG_NAME)-soundwave
|
||
|
#compile smartlink_soundwave
|
||
|
$(MAKE) -C $(PKG_BUILD_DIR)/src/source/soundwave \
|
||
|
MAKE="$(MAKE)" \
|
||
|
ARCH="$(TARGET_ARCH)" \
|
||
|
AR="$(TARGET_AR)" \
|
||
|
CC="$(TARGET_CC)" \
|
||
|
CXX="$(TARGET_CXX)" \
|
||
|
CFLAGS="$(TARGET_CFLAGS)"\
|
||
|
LDFLAGS="$(TARGET_LDFLAGS)" \
|
||
|
CONFIG_LIBC="$(CONFIG_LIBC)" \
|
||
|
CPU="$(ARCH)" \
|
||
|
CONFIG_PREFIX="$(PKG_INSTALL_DIR)" \
|
||
|
all
|
||
|
endef
|
||
|
endif
|
||
|
|
||
|
define Build/Compile
|
||
|
$(Build/Compile/$(PKG_NAME))
|
||
|
$(Build/Compile/$(PKG_NAME)-demo)
|
||
|
$(Build/Compile/$(PKG_NAME)-setup)
|
||
|
$(Build/Compile/$(PKG_NAME)-dhd_priv)
|
||
|
$(Build/Compile/$(PKG_NAME)-raw)
|
||
|
$(Build/Compile/$(PKG_NAME)-xrconfig)
|
||
|
$(Build/Compile/$(PKG_NAME)-xrairkiss)
|
||
|
$(Build/Compile/$(PKG_NAME)-softAP)
|
||
|
$(Build/Compile/$(PKG_NAME)-soundwave)
|
||
|
endef
|
||
|
|
||
|
define Build/InstallDev
|
||
|
$(INSTALL_DIR) $(1)/usr/lib
|
||
|
$(INSTALL_DIR) $(1)/usr/include
|
||
|
|
||
|
$(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/*.so $(1)/usr/lib/
|
||
|
$(INSTALL_DATA) src/include/smartlink_util.h $(1)/usr/include
|
||
|
$(INSTALL_DATA) src/libclient/aw_smartlinkd_connect.h $(1)/usr/include
|
||
|
endef
|
||
|
|
||
|
define Package/$(PKG_NAME)/install
|
||
|
$(INSTALL_DIR) $(1)/lib
|
||
|
$(INSTALL_DIR) $(1)/etc/wifi
|
||
|
$(INSTALL_DIR) $(1)/bin
|
||
|
$(INSTALL_DIR) $(1)/etc/init.d
|
||
|
|
||
|
$(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/libsmartlinkd_client.so $(1)/lib/
|
||
|
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/smartlinkd $(1)/bin/
|
||
|
|
||
|
$(INSTALL_BIN) ./files/smartlinkd.init $(1)/etc/init.d/smartlinkd
|
||
|
endef
|
||
|
|
||
|
define Package/$(PKG_NAME)-demo/install
|
||
|
$(INSTALL_DIR) $(1)/usr/bin
|
||
|
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/smartlinkd_demo $(1)/usr/bin
|
||
|
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/smartlinkd_long_time_test $(1)/usr/bin
|
||
|
endef
|
||
|
|
||
|
define Package/$(PKG_NAME)-soundwave/install
|
||
|
$(INSTALL_DIR) $(1)/usr/bin
|
||
|
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/smartlinkd_soundwave $(1)/usr/bin/
|
||
|
endef
|
||
|
|
||
|
define Package/$(PKG_NAME)-setup/install
|
||
|
$(INSTALL_DIR) $(1)/usr/bin
|
||
|
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/smartlinkd_setup $(1)/usr/bin/
|
||
|
endef
|
||
|
|
||
|
define Package/$(PKG_NAME)-softAP/install
|
||
|
$(INSTALL_DIR) $(1)/usr/bin
|
||
|
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/smartlinkd_softap $(1)/usr/bin
|
||
|
endef
|
||
|
|
||
|
define Package/$(PKG_NAME)-xrconfig/install
|
||
|
$(INSTALL_DIR) $(1)/usr/bin
|
||
|
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/smartlinkd_xrsc $(1)/usr/bin
|
||
|
endef
|
||
|
|
||
|
define Package/$(PKG_NAME)-xrairkiss/install
|
||
|
$(INSTALL_DIR) $(1)/usr/bin
|
||
|
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/smartlinkd_xrairkiss $(1)/usr/bin
|
||
|
endef
|
||
|
|
||
|
#dhd_priv,add by Kirin
|
||
|
define Package/$(PKG_NAME)-dhd_priv/install
|
||
|
$(INSTALL_DIR) $(1)/usr/bin
|
||
|
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/dhd_priv $(1)/usr/bin
|
||
|
endef
|
||
|
|
||
|
#smartlink_raw,add by Kirin
|
||
|
define Package/$(PKG_NAME)-raw/install
|
||
|
$(INSTALL_DIR) $(1)/usr/bin
|
||
|
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/smartlink_raw $(1)/usr/bin
|
||
|
endef
|
||
|
|
||
|
$(eval $(call BuildPackage,$(PKG_NAME)))
|
||
|
$(eval $(call BuildPackage,$(PKG_NAME)-demo))
|
||
|
$(eval $(call BuildPackage,$(PKG_NAME)-setup))
|
||
|
$(eval $(call BuildPackage,$(PKG_NAME)-softAP))
|
||
|
$(eval $(call BuildPackage,$(PKG_NAME)-soundwave))
|
||
|
$(eval $(call BuildPackage,$(PKG_NAME)-xrconfig))
|
||
|
$(eval $(call BuildPackage,$(PKG_NAME)-xrairkiss))
|
||
|
$(eval $(call BuildPackage,$(PKG_NAME)-dhd_priv))
|
||
|
$(eval $(call BuildPackage,$(PKG_NAME)-raw))
|