2017年2月3日 星期五

LinkIt 7688 SDK 筆記

package/Makefile

mt7688sdk/package/your_package/Makefile 寫法是有講究的

helloworld 為例,如果你把 helloworld/Makefile Line 4 與 Line 6 調換會如何?(為了節省版面,Line 編號可能與實際 Makefile 內的編號不一樣,但 Line 4,6的內容一樣,並且只有出現一次)

調換前:
# This specifies the directory where we're going to build the program.
# The root build directory, $(BUILD_DIR), is by default the build_mipsel
# directory in your OpenWrt SDK directory
PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)

include $(INCLUDE_DIR)/package.mk
調換後:
# This specifies the directory where we're going to build the program.
# The root build directory, $(BUILD_DIR), is by default the build_mipsel
# directory in your OpenWrt SDK directory
include $(INCLUDE_DIR)/package.mk

PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)
編譯:
mt7688sdk# make package/helloworld/compile
編譯結果:


怎麼會這樣呢?

這是因為當 include 在 PKG_BUILD_DIR 之前時,必須把 -$(PKG_VERSION) 加在 PKG_BUILD_DIR... 的尾端:
# This specifies the directory where we're going to build the program.
# The root build directory, $(BUILD_DIR), is by default the build_mipsel
# directory in your OpenWrt SDK directory
include $(INCLUDE_DIR)/package.mk

PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
這次就沒問題了:


Q. 安裝完 Unbuntu 14.04 LTS 64bit Desktop 與 7688 SDK 後為何無法編譯 helloworld?

A.


筆者的經驗是少了 gawk 與 ccache,補上即可:
# apt-get install gawk
# apt-get install ccache

沒有留言:

張貼留言