方法一
	1、生成SDK
	make menuconfig选上“Build the OpenWRT SDK”,然后 Save,退出。再make一次。
	make 完成之后,在 bin/ramips/ 目录下会生成SDK的压缩文件:
	OpenWrt-SDK-ramips-rt305x_gcc-4.8-linaro_uClibc-0.9.33.2.Linux-x86_64.tar.bz2
2、安装SDK
	把上面生成的OpenWrt-SDK-ramips-rt305x_gcc-4.8-linaro_uClibc-0.9.33.2.Linux-x86_64.tar.bz2解压到别的目录下
	3、创建helloworld项目
	其实,这里可以是任意我们想要加入的程序,库等。这里就以helloword为例。
	在任意路径下,创建helloword项目。比如这里还是在 ~/Workspace/OpeWRT 目录下。 
	$ cd ~/Workspace/OpenWRT
	$ mkdir helloword
	$ cd helloword
	$ touch helloword.c Makefile
	在 ~/Workspace/OpenWRT/ 目录下创建了 helloword 目录,并生成 helloword.c与Makefile文件。
	如下为 helloworld.c的内容: 
	#include <stdio.h>
	int main()
	{
	printf("This is my hello word!\n");
	return 0;
	}
	Makefile的内容: 
	helloworld : helloworld.o
	$(CC) $(LDFLAGS) helloworld.o -o helloworld
	helloworld.o : helloworld.c
	$(CC) $(CFLAGS) -c helloworld.c
	clean :
	rm *.o helloworld
	自己make一下确保程序没有问题,一定要注意tab键空格。
	4、创建helloworld包
	进入 OpenWrt/Packages/ 并在该目录下创建 helloworld 目录,并进入该目录。
	$ cd ~/Workspace/OpenWrt/OpenWrt-SDK/package
	$ mkdir helloworld
	$ cd helloworld
	将我们第三步写的程序复制到这个目录下来,更名为src。再新建一个 Makefile 文件。 
	$ cp -r ../../../helloworld src
	$ touch Makefile
	整个过程下来,package目录结构如下: 
	package
	|-- helloworld
	|   |-- Makefile
	|   `-- src
	|       |-- helloworld.c
	|       `-- Makefile
	`-- Makefile
	Makefile 文件如下:
	include $(TOPDIR)/rules.mk
	PKG_NAME:=helloworld
	PKG_RELEASE:=1
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)
include $(INCLUDE_DIR)/package.mk
	define Package/helloworld
	SECTION:=utils
	CATEGORY:=Utilities
	TITLE:=Hello world!!!
	DEPENDS:=+libwebsockets +libsqlite3 +libjson-c
	endef
	define Package/helloworld/description
	It's my first package demo.
	endef
	define Build/Prepare
	mkdir -p $(PKG_BUILD_DIR)
	$(CP) ./src/* $(PKG_BUILD_DIR)/
	endef
	define Package/helloworld/install
	$(INSTALL_DIR) $(1)/usr/sbin
	$(INSTALL_BIN) $(PKG_BUILD_DIR)/$(PKG_NAME) $(1)/usr/sbin
	endef
	$(eval $(call BuildPackage,helloworld))
	make -j1 V=s 成功了。生成了 helloworld_1_ramips_24kec.ipk。
	5、试验helloworld
	通过WinSCP把ipk上能到openwrt根目录下的/tmp
	cd /tmp
	opkg install helloworld_1_ramips_24kec.ipk
	用which命令查看 helloworld 安装的路径:
	which helloworld
	在 /bin/ 路径下
	cd /bin
	helloworld
	
	方法二
	1、创建helloworld项目
	把方法一创建helloworld文件夹复制到openwrt根目录下的package。
	2、选择helloworld项目
	make menuconfig
	Utilities——》helloworld勾选上并保存退出
	make -j3 V=s
	如果要单独编译模块:
	make package/helloworld/compile
	make package/helloworld/install
	3、试验helloworld 
	cd /bin
	helloworld
	4、后续开发
把新helloworld文件替换旧hellworld文件
重新编译
	make package/helloworld/compile
	在openwrt目录的./build_dir/target-mipsel_24kec+dsp_uClibc-0.9.33.2/helloworld/ipkg-ramips_24kec/helloworld/bin下找到重新生成的helloworld文件,重新替换路由器/bin下面的helloworld。
	
	上面的内容本人是参照网上文档并自己实践过。
	
	openwrt添加VPN拨号:http://www.linuxdiyf.com/linux/15347.html
制作一个openwrt路由器系统使用的kms激活服务安装包:http://www.linuxdiyf.com/linux/14342.html
Ubuntu下架设FTP服务器实现Windows、openwrt、ubuntu互传文件:http://www.linuxdiyf.com/linux/13394.html
BPI-R1为openwrt安装中文支持以及安装软件教程:http://www.linuxdiyf.com/linux/13315.html
从零开始学习OpenWrt完美教程:http://www.linuxdiyf.com/linux/12274.html

