2 writing a makefile, 2 writing a makefile -3 – Solvline Eddy DK Ver 2.20 User Manual

Page 33

Advertising
background image

Chapter4. Compiling Application

4.2 Writing a Makefile

In order to compile an application, Makefile should be created or modified and all compile information should be

correctly defined.

The following shows a Makefile of the sample program at /src/Eddy_APPs/.

The figure below shows part where the environment setting values needed at compiling process are configured. It

contains environment values needed when running Make command. When the user wants to compile, add the name

at “TARGET” inside red box marked below.

For example, you can add Hello_World.

First you can make Hello_World.c as follows.

CROSS

= /opt/lemonix/cdt/bin/arm-linux-

LDFLAGS

+= -L/opt/lemonix/cdt/lib -L/opt/lemonix/cdt/bin

IFLAGS

+= -I/opt/lemonix/cdt/include -I./include

CFLAGS

= -O2 -g -Wall -Wno-nonnull

DEST

=

../../ramdisk/root/sbin

DEST_ETC =

../../ramdisk/root/etc


CC

= $(CROSS)gcc

STRIP

=

$(CROSS)strip

AR

=

$(CROSS)ar


TARGET

=

Hello_World

ddns_agent udp def pinetd tcp_server tcp_client

tcp_multiplex tcp_broadcast detect portview upgrade eddy loopback rt-test
LIBS

= -lrt SB_APIs/SB_APIs.a

1 #include <stdio.h>

2

3 int main()

4 {

5 printf("hello world !!!\n");

6 return 0;

7 }

8








4-3

Advertising