[uClinux-dev] Compiling apps

mirco cremasco mirco.cremasco at informacitta.it
Mon Mar 10 11:19:17 EST 2003


mirco cremasco wrote:

> How to compile an application without adding it to the uClinux 
> distribution tree??
> I've tryed to compiling including vendors/config/m68knommu/config.arch 
> (with some modifications) in my own Makefile but I get the following 
> message:
> ...
> fpgaio.elf2flt(.text+0x8): undefined reference to '__uClibc_main'
> ...
>
> Any suggestions??
> Thanks
> Mirco
>
Sorry for the stupid question, I've found by myself...
I'll report how I made so others newbies (like me) can find it with google.

My steps:
1) cp vendors/config/m68knommu/config.arch mysrc/config
2) edit config adding at the beginnig:
CONFIG_VENDOR=Motorola
CONFIG_PRODUCT=M5272C3
CONFIG_LINUXDIR=linux-2.4.x
CONFIG_LIBCDIR=uClibc
CONFIG_LANGUAGE=
CONFIG_USER_DEBUG=y
CPUFLAGS  = -m5307 -fomit-frame-pointer
VENDOR_CFLAGS = -DCONFIG_COLDFIRE -lc
UCLINUX_BUILD_USER =y

LINUXDIR = $(CONFIG_LINUXDIR)
LIBCDIR  = $(CONFIG_LIBCDIR)
ROOTDIR  = ~/uClinux-dist
PATH     := $(PATH):$(ROOTDIR)/tools
HOSTCC   = unset GCC_EXEC_PREFIX; cc
IMAGEDIR = $(ROOTDIR)/images
ROMFSDIR = $(ROOTDIR)/romfs
ROMFSINST= $(ROOTDIR)/tools/romfs-inst.sh
SCRIPTSDIR = $(ROOTDIR)/config/scripts
TFTPDIR    = /tftpboot

3) Edit a Makefile:

include config

EXEC = myapp
OBJS = myapp.o

all: $(EXEC)

$(EXEC): $(OBJS)
    $(CC) $(LDFLAGS) -o $@ $(OBJS) -lc

romfs:
    $(ROMFSINST) /bin/$(EXEC)

clean:
    -rm -f $(EXEC) *.elf *.gdb *.o




Bye
Mirco Cremasco




More information about the uClinux-dev mailing list