107 lines
3.8 KiB
Makefile
Executable File
107 lines
3.8 KiB
Makefile
Executable File
include $(TOPDIR)/rules.mk
|
|
|
|
PKG_NAME:=submodule_netease_control_center
|
|
PKG_RELEASE:=2
|
|
PKG_VERSION:=0.0.2
|
|
COMMIT_HASH:=$(shell git rev-parse HEAD 2>/dev/null)
|
|
BUILD_DATE:=$(shell TZ='Asia/Shanghai' date '+%Y-%m-%d_%H:%M:%S')
|
|
GIT_TAG:=$(shell git describe --tags `git rev-list --tags --max-count=1`)
|
|
|
|
PKG_BUILD_DIR := $(COMPILE_DIR)/$(PKG_NAME)
|
|
|
|
HARDWARE_VERSION:=DVT
|
|
|
|
include $(BUILD_DIR)/package.mk
|
|
|
|
ifeq ('$(CONFIG_BOARD_HARDWARE_VERSION_DVT)', 'y')
|
|
HARDWARE_VERSION=DVT
|
|
else
|
|
|
|
ifeq ('$(CONFIG_BOARD_HARDWARE_VERSION_EVT)', 'y')
|
|
HARDWARE_VERSION=EVT
|
|
else
|
|
HARDWARE_VERSION=NA
|
|
endif
|
|
|
|
endif
|
|
|
|
|
|
define Package/$(PKG_NAME)
|
|
SECTION:=utils
|
|
CATEGORY:=Netease
|
|
TITLE:=Netease control center submodule
|
|
MAINTAINER:=Wang zijiao <hzwangzijiao@corp.netease.com>
|
|
DEPENDS:=+libpthread +libspeex +alsa-lib +wifimanager +bluetooth +softap +libuvdbus +libuuid +libcutils +libcjson +libs2json
|
|
endef
|
|
|
|
define Package/$(PKG_NAME)/description
|
|
This is a golang control center program in submodule!
|
|
endef
|
|
|
|
define Build/Prepare
|
|
mkdir -p $(PKG_BUILD_DIR)
|
|
$(CP) -d ./src $(PKG_BUILD_DIR)/
|
|
endef
|
|
|
|
define Build/Configure
|
|
endef
|
|
|
|
define Build/Compile
|
|
@echo Begin compile go program!
|
|
@echo $(STAGING_DIR)
|
|
@echo begin ....
|
|
@echo PRODUCT_NAME: $(TARGET_BOARD) $(HARDWARE_VERSION) $(GIT_TAG)
|
|
|
|
cd $(PKG_BUILD_DIR)/src/$(PKG_NAME) && GOPATH=$(PKG_BUILD_DIR) glide install
|
|
cd $(PKG_BUILD_DIR)/src/$(PKG_NAME) && \
|
|
AR="$(TARGET_AR)" \
|
|
CC="$(TARGET_CC)" \
|
|
CXX="$(TARGET_CXX)" \
|
|
CGO_CFLAGS="$(TARGET_CFLAGS) -I$(CONFIG_TOOLCHAIN_ROOT)/include -I$(STAGING_DIR)/usr/include -I$(STAGING_DIR)/include" \
|
|
CGO_LDFLAGS="$(TARGET_LDFLAGS)" \
|
|
GOPATH=$(PKG_BUILD_DIR) GOOS=linux GOARCH=arm CGO_ENABLED=1 go build -tags "netcgo json1" \
|
|
-ldflags "-X \"main.Hv=$(HARDWARE_VERSION)\" -X \"main.BuildVersion=$(COMMIT_HASH)\" -X \"main.BuildDate=$(BUILD_DATE)\" -X \"main.Tag=$(GIT_TAG)\""
|
|
|
|
cd $(PKG_BUILD_DIR)/src/$(PKG_NAME)/modules/hardware/mcu_leds && \
|
|
AR="$(TARGET_AR)" \
|
|
CC="$(TARGET_CC)" \
|
|
CXX="$(TARGET_CXX)" \
|
|
CGO_CFLAGS="$(TARGET_CFLAGS)" \
|
|
CGO_LDFLAGS="$(TARGET_LDFLAGS)" \
|
|
GOPATH=$(PKG_BUILD_DIR) GOOS=linux GOARCH=arm CGO_ENABLED=1 go build -o mcu_ota
|
|
|
|
cd $(PKG_BUILD_DIR)/src/$(PKG_NAME)/nembd/evdev/bin && \
|
|
AR="$(TARGET_AR)" \
|
|
CC="$(TARGET_CC)" \
|
|
CXX="$(TARGET_CXX)" \
|
|
CGO_CFLAGS="$(TARGET_CFLAGS)" \
|
|
CGO_LDFLAGS="$(TARGET_LDFLAGS)" \
|
|
GOPATH=$(PKG_BUILD_DIR) GOOS=linux GOARCH=arm CGO_ENABLED=1 go build -o netease_keytest
|
|
endef
|
|
|
|
define Package/$(PKG_NAME)/install
|
|
$(INSTALL_DIR) $(1)/usr/sbin
|
|
$(INSTALL_DIR) $(1)/etc/init.d
|
|
$(INSTALL_DIR) $(1)/usr/share/golang
|
|
$(INSTALL_DIR) $(1)/usr/share/golang/mcu
|
|
$(INSTALL_DIR) $(1)/etc/ssl/certs
|
|
$(INSTALL_BIN) $(PKG_BUILD_DIR)/src/$(PKG_NAME)/$(PKG_NAME) $(1)/usr/sbin/
|
|
$(INSTALL_BIN) ./backuplocalfiles.sh $(1)/usr/sbin/
|
|
$(INSTALL_BIN) $(PKG_BUILD_DIR)/src/$(PKG_NAME)/modules/hardware/mcu_leds/mcu_ota $(TOPDIR)/prebuilt/r16/
|
|
$(INSTALL_BIN) $(PKG_BUILD_DIR)/src/$(PKG_NAME)/nembd/evdev/bin/netease_keytest $(1)/usr/sbin/
|
|
$(INSTALL_BIN) ./netease.init $(1)/etc/init.d/netease_services
|
|
$(INSTALL_BIN) ./neteasewifi.init $(1)/etc/init.d/netease_wifi_service
|
|
$(INSTALL_BIN) ./neteasevoice.init $(1)/etc/init.d/netease_voice_service
|
|
$(INSTALL_BIN) ./neteaseplayer.init $(1)/etc/init.d/netease_player_service
|
|
$(INSTALL_BIN) ./neteasemanufacture_cc.init $(1)/etc/init.d/netease_cc_manufacture_service
|
|
$(INSTALL_BIN) ./neteasemanufacture_mcu.init $(1)/etc/init.d/netease_mcu_manufacture_service
|
|
$(INSTALL_BIN) ./neteasemanufacture_rf.init $(1)/etc/init.d/netease_rf_manufacture_service
|
|
$(INSTALL_BIN) ./neteasecc.init $(1)/etc/init.d/netease_cc_service
|
|
$(INSTALL_BIN) ./neteasebt.init $(1)/etc/init.d/netease_bt_service
|
|
$(INSTALL_DATA) mcu/* $(1)/usr/share/golang/mcu/
|
|
$(INSTALL_DATA) vol_adc.config $(1)/usr/share/golang/
|
|
# $(INSTALL_DATA) ./ca-certificates.crt $(1)/etc/ssl/certs/
|
|
endef
|
|
|
|
$(eval $(call BuildPackage,$(PKG_NAME)))
|