1. 进入 OpenWrt 源码目录,并进入 package 目录:
cd openwrt/package
  1. 创建一个新目录,命名为 hello :
mkdir hello
  1. 进入到 hello 目录中,并创建以下目录结构:
├── Makefile
└── src
    └── hello.c

其中 src 目录中的 hello.c 和 Makefile 是源代码和编译 Makefile。

  1. 编写 Makefile 文件:

在 hello 目录中创建 Makefile 文件,内容为:

include $(TOPDIR)/rules.mk

PKG_NAME:=hello
PKG_VERSION:=1.0
PKG_RELE
08-31 09:06