
Hi again,
I have got the build working. Here is a foo.c and a simple Makefile that runs with CodeSourcery's 3.4.3 toolchain:
/* * foo.c */
#include <common.h> #include <exports.h>
int main (int argc, char *argv[]) { app_startup(argv); printf ("Voila! Voila!"); return (0); }
The Makefile:
# Makefile # Tools
CROSS = /usr/local/arm/3.4.3/bin/arm-none-linux-gnueabi- CC = $(CROSS)gcc AS = $(CROSS)as LD = $(CROSS)ld OBJCOPY = $(CROSS)objcopy
TARGET = foo BASE = 0x04000000
CFLAGS = -g -Os -fno-strict-aliasing -fno-common -ffixed-r8 -msoft-float -D__KERNEL__ -fno-builtin -ffreestanding -nostdinc -isystem /usr/local/arm/3.4.3/bin/../lib/gcc/arm-non-linux-gnueabi/3.4.3/include -pipe -DCONFIG_ARM -D__ARM__ -march=armv4 -Wall -Wstrict-prototypes
INCLUDE = -I/home/shaks/docs/monitor/u-boot/u-boot-1.1.2/include -I/usr/local/arm/3.4.3/lib/gcc/arm-none-linux-gnueabi/3.4.3/include
LIBSTUBS = /home/shaks/docs/monitor/u-boot/u-boot-1.1.2/examples/libstubs.a LGCC = -L/usr/local/arm/3.4.3/bin/../lib/gcc/arm-none-linux-gnueabi/3.4.3 -lgcc -L/home/shaks/docs/monitor/u-boot/u-boot-1.1.2/examples -lstubs
LIBSTUB_INCLUDE = /usr/local/arm/3.4.3/bin/../lib/gcc/arm-none-linux-gnueabi/3.4.3/include LDFLAGS = -g -Ttext $(BASE) -e main
all: $(CC) $(CFLAGS) $(INCLUDE) -c $(TARGET).c -o $(TARGET).o $(LD) $(INCLUDE) $(LDFLAGS) $(TARGET).o -o $(TARGET) $(LIBSTUBS) $(LGCC) $(OBJCOPY) -O binary $(TARGET) $(TARGET).bin 2>/dev/null
clean: rm -f *~ *.o *.bin $(TARGET)
Voila! Voila!
SK
-- Shakthi Kannan, MS Software Engineer, Specsoft (Hexaware Technologies) [E]: shakthimaan@yahoo.com [M]: (91) 98407-87007 [W]: http://www.shakthimaan.com [L]: Chennai, India
__________________________________ Yahoo! FareChase: Search multiple travel sites in one click. http://farechase.yahoo.com