Hello,
My configuration :
Olimex Sam9_9260 with default linux 2.6.23 uclibc installation
NB
Cross chain on Linux ubuntu :
gcc 3.4
Comes from olimex CD
I have been able to successfully cross compile and then run the linux kernel with this installation.
my Makefile :
TRGT = arm-linux-
CC = $(TRGT)gcc
CP = $(TRGT)objcopy
AS = $(TRGT)gcc -x assembler-with-cpp
BIN = $(CP) -O ihex
MCU = arm9
List all default C defines here, like -D_DEBUG=1
DDEFS =
List all default ASM defines here, like -D_DEBUG=1
DADEFS =
List all default directories to look for include files here
DINCDIR =
List the default directory to look for the libraries here
DLIBDIR = /usr/local/arm/3.4/lib
List all default libraries here
DLIBS =
End of default section
##############################################################################################
##############################################################################################
Start of user section
Define project name here
PROJECT = salut
List all user C define here, like -D_DEBUG=1
UDEFS =
Define ASM defines here
UADEFS =
List C source files here
SRC = ./src/hello.c ./src/main.c
List ASM source files here
ASRC =
List all user directories here
UINCDIR = ./inc
List the user directory to look for the libraries here
ULIBDIR =
List all user libraries here
ULIBS =
Define optimisation level here
OPT = -O0
End of user defines
##############################################################################################
INCDIR = $(patsubst %,-I%,$(DINCDIR) $(UINCDIR))
LIBDIR = $(patsubst %,-L%,$(DLIBDIR) $(ULIBDIR))
DEFS = $(DDEFS) $(UDEFS)
ADEFS = $(DADEFS) $(UADEFS)
OBJS = $(ASRC:.S=.o) $(SRC:.c=.o)
LIBS = $(DLIBS) $(ULIBS)
MCFLAGS = -mcpu=$(MCU)
ASFLAGS = $(MCFLAGS) -g -gdwarf-2 -Wa,-amhls=$(<:.S=.lst) $(ADEFS)
#CPFLAGS = $(MCFLAGS) $(OPT) -gdwarf-2 -mthumb-interwork -fomit-frame-pointer -Wall -Wstrict-prototypes -fverbose-asm -Wa,-ahlms=$(<:.c=.lst) $(DEFS)
LDFLAGS = $(MCFLAGS) -Wl,–cref,–no-warn-mismatch $(LIBDIR)
CPFLAGS = $(MCFLAGS) $(OPT)
Generate dependency information
CPFLAGS += -MD -MP -MF .dep/$(@F).d
makefile rules
all: $(OBJS) $(PROJECT).elf
%o : %c
$(CC) -c $(CPFLAGS) -I . $(INCDIR) $< -o $@
%o : %S
$(AS) -c $(ASFLAGS) $< -o $@
%elf: $(OBJS)
$(CC) $(OBJS) $(LDFLAGS) $(LIBS) -o $@
%hex: %elf
$(BIN) $< $@
clean:
-rm -f $(OBJS)
-rm -f $(PROJECT).elf
-rm -f $(PROJECT).map
-rm -f $(PROJECT).hex
-rm -f $(SRC:.c=.c.bak)
-rm -f $(SRC:.c=.lst)
-rm -f $(ASRC:.S=.S.bak)
-rm -f $(ASRC:.S=.lst)
-rm -fR .dep
When the copy the result (salut.elf) on the olimex board with ftp and do the chmod +x salut.elf then run ./salut.elf the result is :
-bash: ./salut.elf : No such file or directory
I must be stupid but i am stuck can anybody help me …
Best regards
Philippe :evil: