Chinaunix首页 | 论坛 | 博客
  • 博客访问: 412617
  • 博文数量: 99
  • 博客积分: 65
  • 博客等级: 民兵
  • 技术积分: 1012
  • 用 户 组: 普通用户
  • 注册时间: 2012-04-20 16:30
个人简介

linux kernel 工程师

文章分类

全部博文(99)

文章存档

2018年(5)

2017年(12)

2016年(27)

2015年(10)

2014年(43)

2012年(2)

我的朋友

分类: LINUX

2018-01-31 11:03:16

How to build app using WRLinux SDK

1. Prepare sdk
===============

In $PRJ directory, execute  
# make export-sdk
then ensure that wrlinux-8.0.0.24-glibc-x86_64-intel_x86_64-wrlinux-image-glibc-std-sdk.sh is generated in $PRJ/export.


Copy the sdk to a work directory and extract the sdk.
# cp $PRJ/export/wrlinux-8.0.0.24-glibc-x86_64-intel_x86_64-wrlinux-image-glibc-std-sdk.sh /path-to-work-dir
# cd /path-to-work-dir
# ./wrlinux-8.0.0.24-glibc-x86_64-intel_x86_64-wrlinux-image-glibc-std-sdk.sh

Setup the buid env
# source ./env.sh


2. An example for building app
==============================

a. Create a directory to create app source.

b. Generate a C file in the app source as below:

/* hello.c */
#include

int main(int argc, char *argv[])
{
    printf("Hello world!\n");

    return 0;
}


c. Generate a Makefile in the app source as below:

#Makefile for app

all:hello

hello: hello.c
    $(CC) -o $@ $^

clean:
    rm -rf hello

d. Build the app
# make
then the 'hello' is generated.
阅读(969) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~