1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Newbie question: Compiling small application

Discussion in 'Tomato Firmware' started by gizmosforyou, May 8, 2008.

  1. gizmosforyou

    gizmosforyou Addicted to LI Member

    Hello all,

    I have been using the Tomato firmware and has been impressed by it’s essential feature set, modest size and rock solid stability. The VPN/MMC/Serial modded version from Roadkill has been a real boon for my immediate needs too.

    I am a newbie to the embedded Linux scene and see the WRT54Gx series as a good learning platform and would like to use it for that effect. I have setup the Tomato source code and tool chain and can successfully compile the firmware from the source.

    I need some help from you guys to get started with this. I am not sure if this is the right forum to ask a question that is too basic. I am trying to get a standalone application compiled into Tomato to be run from the command line. For example I want the following to be compiled into the /usr/sbin directory of Tomato when the Tomato source code is compiled from source:

    Code:
    
    test.c
    
    #include<stdio.h>
     
    void main()
    {
       printf("Hello World\n");
    }
    
    
    How do I go about doing it? What changes needs to be made to other files like the Makefile, configuration file, etc. Any advanced users here can give me the details?

    Thank you,

    Gizmos
     
  2. nvtweak

    nvtweak LI Guru Member

    you need to create Makefile for your app. Source files can go in src/router/helloworld for example.

    Then edit src/router/Makefile to compile it

    Look at src/router/httpd/Makefile as an example.
     
  3. gizmosforyou

    gizmosforyou Addicted to LI Member

    Thank you very much!
     

Share This Page