Compiling C and C++ Programs for Stargate

Example Program

hello.c

    #include <stdio.h>
    main()
    {
      printf ("Hello world\n");
    }

Example Makefile

An example compile command for a program in foo.c on the PXA255 is:

arm-linux-gcc –mcpu=xscale –mtune=xscale foo.c

Makefile

    CC = arm-linux-gcc

    hello: hello.o
            $(CC) hello.o -o hello

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

    clean:
            rm -f hello.o
            rm hello