include $(TOPDIR)/rules.mk include $(TINA_BUILD_TOP)/package/netease/submodules/Makefile.common.submodule PKG_NAME:=netease_control_center PKG_RELEASE:=2 PKG_VERSION:=0.0.2 PKG_BUILD_DIR := $(COMPILE_DIR)/$(PKG_NAME) include $(BUILD_DIR)/package.mk define Package/$(PKG_NAME) SECTION:=utils CATEGORY:=Netease TITLE:=Netease control center submodule MAINTAINER:=Wang zijiao DEPENDS:=+libpthread +libspeex +alsa-lib +wifimanager +bluetooth +softap +libuvdbus +libuuid +libcutils +libcjson +libs2json +libiconv-full 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 sqlite_json sqlite_trace" \ -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) $(PKG_BUILD_DIR)/src/$(PKG_NAME)/modules/hardware/mcu_leds/mcu_ota $(TOPDIR)/prebuilt/r311/ $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/$(PKG_NAME)/nembd/evdev/bin/netease_keytest $(1)/usr/sbin/ $(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)))