oppkg/hi/Makefile

41 lines
1.1 KiB
Makefile
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# 导入通用编译规则
include $(TOPDIR)/rules.mk
# name和version用来定义编译目录名$(PKG_BUILD_DIR)]
PKG_NAME:=helloworld2
PKG_VERSION:=1.0
PKG_RELEASE:=1
#PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME) # 也可以直接定义编译目录名,代替默认的目录名
# 导入包定义
include $(INCLUDE_DIR)/package.mk
# 包定义定义我们的包在menuconfig中的位置
# Makefile中的define语法可以理解为函数用于定义命令集合
define Package/helloworld2
SECTION:=examples
CATEGORY:=Examples
TITLE:=helloworld2, learn from example.
endef
# 包描述:关于我们包的更详细的描述
define Package/helloworld2/description
A simple helloworld2 example, my first openwrt package example.
endef
# 编译准备. 必须使用tab缩进表示是可执行的命令
define Build/Prepare
echo "Here is Build/Prepare"
mkdir -p $(PKG_BUILD_DIR)
cp ./src/* $(PKG_BUILD_DIR)/
endef
# 安装
define Package/helloworld2/install
$(INSTALL_DIR) $(1)/usr/bin
$(INSTALL_BIN) $(PKG_BUILD_DIR)/helloworld2 $(1)/usr/bin
endef
# 这一行总是在最后
$(eval $(call BuildPackage,helloworld2))