1、各类文件的书写
src中的文件:
hello文件夹中的Makefile文件
# # Copyright (C) 2010-2012 OpenWrt.org # # This is free software, licensed under the GNU General Public License v2. # See /LICENSE for more information. # include $(TOPDIR)/rules.mk PKG_NAME:=hello PKG_VERSION:=1 PKG_RELEASE:=1 include $(INCLUDE_DIR)/package.mk define Package/hello SECTION:=utils CATEGORY:=Utilities TITLE:=hello MAINTAINER:=tingpan PKGARCH:=all endef define Package/hello/description hello world! endef define Build/Prepare mkdir -p $(PKG_BUILD_DIR) $(CP) ./src/* $(PKG_BUILD_DIR)/ endef define Build/Configure endef define Build/Compile $(MAKE) -C $(PKG_BUILD_DIR) CC="$(TARGET_CC)" CFLAGS="$(TARGET_CFLAGS) -Wall" LDFLAGS="$(TARGET_LDFLAGS)" endef define Package/hello/install $(INSTALL_DIR) $(1)/usr/sbin $(INSTALL_BIN) $(PKG_BUILD_DIR)/hello $(1)/usr/sbin/ endef $(eval $(call BuildPackage,hello))
2、配置及编译
3、用scp上传
3.1、复制到win7桌面
4、CRT登陆
4.1 登陆
4.2 命令行运行
查看
ls
安装ipk
opkg install **.ipk
运行
hello
卸载
opkg remove **