| Next revision | Previous revision Next revisionBoth sides next revision |
| zh:docs:guide-developer:using_the_sdk [2019/03/26 09:28] – created penghanye | zh:docs:guide-developer:using_the_sdk [2019/03/28 03:34] – [Compile Packages] penghanye |
|---|
| ==== 选择软件包 ==== | ==== 选择软件包 ==== |
| |
| Open a terminal in the SDK's folder and then open the SDK's menu by writing ''make menuconfig'' The SDK menuconfig system is the same as the buildroot. Instructions are at the top, and help is available via the ''?'' key. | 在SDK的目录下打开一个终端, 然后使用''make menuconfig''命令打开SDK的菜单. SDK menuconfig 系统和buildroot一样. 在上面有说明, 也可用通过''?''键获取帮助. |
| |
| You //probably// want to disable some default settings, which build every available package. | //也许//你会想要禁用掉一些默认配置, 因为它们会构建所有的软件包. |
| Enter ''Global Build Settings'' and in the submenu, deselect/exclude the following options: | 进入 ''Global Build Settings'' 在子菜单中, 取消/排除以下选项: |
| * ''Select all target specific packages by default'' | * ''Select all target specific packages by default'' |
| * ''Select all kernel module packages by default'' | * ''Select all kernel module packages by default'' |
| * ''Select all userspace packages by default'' | * ''Select all userspace packages by default'' |
| |
| Still in the menu, find the package you want to build and select it by pressing "m", this will also select all the dependencies, and you will see that they are all tagged with "<M>" in the menu. You can select multiple packages too. | 还是在菜单中, 找到你想要构建的软件包, 按"m"来选中它, 这样也会包含所有的依赖, 而且也能看到它们在菜单中都被标识为"<M>". 也可以选择多个软件包. |
| |
| Save the configuration and exit the menu. | 保存配置并退出菜单. |
| |
| ==== Compile Packages ==== | ==== 编译软件包 ==== |
| After the Makefile is in place, the usual buildroot commands apply: | 建好Makefile之后, 就可以使用常规的buildroot命令: |
| |
| * ''make package///example///download'' - download the soures of //example// | * ''make package///example///download'' - 下载 //example// 的源码 |
| * ''make package///example///prepare'' - extract the sources, apply patches and download if necessary | * ''make package///example///prepare'' - 提取源码, 如果需要的话再下载补丁源码并使用 |
| * ''make package///example///compile'' - compile //example//, prepare and download if necessary | * ''make package///example///compile'' - 编译 //example//, 如果需要的话,先进行download和prepare |
| * ''make package///example///clean'' - clean the sourcecode | * ''make package///example///clean'' - 清除源码 |
| * ''make package/index'' - build a repository index to make the output directory usable as local //opkg// source | * ''make package/index'' - 构建仓库索引, 将输出目录变成一个本地的//opkg//源 |
| |
| Or just ''make'' to build everything selected. (You can compile faster by writing ''make -j5'' or similar as appopriate for your build host) | 或者直接运行 ''make'' 来构建所有被选中的东西. (可以用''make -j5'' 来加快构建, 或选择合适你的宿主机的参数) |
| |
| After the compilation is finished, the generated .ipk files are placed in the bin/packages and bin/targets directories inside the directory you extracted the SDK into. | 编译完成后, 生成的.ipk会被移动到SDK的解压目录的 bin/packages 和 bin/targets 目录中. |
| |
| ===== Troubleshooting ===== | ===== 故障 ===== |
| :!: Some SDK versions have bugs.... | :!: 某些版本的SDK会有bugs.... |