Writing application program, Writing makefile, 2 writing application program – Solvline Eddy DKV2.1.0.3 User Manual

Page 72: 3 writing makefile

Advertising
background image

Chapter 4. Compiling of

Application Program

72

4.2 Writing Application Program

This chapter shows how to write an application program for Eddy.
First, create a ‚hello_world.c‛ file under the ‚scr/Eddy_APPs‛ directody.

4.3 Writing Makefile

To compile an application program, compile information of the application program has to be
registered on the Eddyy_APPs/Makefile directory. The below is description of ‚Makefile‛ under
directory of src/Eddy_APPs/.
The picture blow shows the environment setting area for an application program compile.
Add a name under the ‚TARGET‛ highlighted as red, and register to the compile environment.

#include <stdio.h>

int main()
{
While (1)
{

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

sleep (1);
}
}


TARGET = eddy pinetd def ddns_agent \
upgrade portview upgradetftp detect \
tcp_server tcp_client tcp_multiplex tcp_broadcast \
udp rt_test

hello_world

udp : udp.o

rm -f $@

$(CC) $(CFLAGS) $(LDFLAGS) $(IFLAGS) -o $@ $ [email protected] $(LIBS)

$(STRIP) $@

Hello_World : Hello_World.o

Rm -f $@

$(CC) $(CFLAGS) $(LDFLAGS) $(IFLAGS) -o $@ $ [email protected]

$(STRIP) $@

Advertising