This commit is contained in:
chinky 2023-10-23 13:09:12 +00:00
parent 1364356dc6
commit fc0f0458b7
2 changed files with 10 additions and 10 deletions

View File

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

View File

@ -1,5 +1,5 @@
TARGET = hellwworld2
OBJS = hellwworld2.o
TARGET = helloworld2
OBJS = helloworld2.o
$(TARGET):$(OBJS)
$(CC) $(LDFLAGS) -o $@ $^