Codesourcery toolchain for coldfire and eclipse
David A Perlaza G
daperlazag at gmail.com
Wed Mar 24 18:28:40 UTC 2010
Hello.
I am trying to compile my first "Hello World" project using Eclipse and
the Codesourcery tool chain. I have configured and installed everything
but I get this error when try to build:
mkdir: cannot make directory `.obj\src': No such file or directory
Description Resource Path Location Type
Fatal error: can't create .obj/src/hello.o: No such file or
directory hello line 0 C/C++ Problem
Attached is my makefile. Should I replace the dot in the Proj_dir line
with my project path? I am using GNUWIN32 utilities to have the
command line capabilities of linux OS on my windows XP installation.
Many thanks in advance for your help.
Best regards,
--
David Alejandro Perlaza Goyeneche
Ingeniero Electrónico
Universidad Nacional de Colombia
-------------- next part --------------
##############################################################################################
# Start of default section
#
TRGT = m68k-elf-
CC = $(TRGT)gcc
CP = $(TRGT)objcopy
AS = $(TRGT)gcc -x assembler-with-cpp
BIN = $(CP) -O binary
# 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 =
# List all default libraries here
DLIBS =
#
# End of default section
##############################################################################################
##############################################################################################
# Start of user section
#
# Define project name here
PROJECT = hello
PROJ_DIR = .
# Define linker script file here
LDSCRIPT = "C:\Archivos de programa\CodeSourcery\Sourcery G++ Lite\m68k-elf\lib\m5208\m5282evb-ram.ld"
#C:\Archivos de programa\CodeSourcery\Sourcery G++ Lite\m68k-elf\lib\m51qe\mcf51cn128-ram.ld
# List all user C define here, like -D_DEBUG=1
UDEFS =
# Define ASM defines here
UADEFS =
# List C source files here
SRC = $(PROJ_DIR)/src/hello.c \
# List ASM source files here
#ASRC =
# List all user directories here
UINCDIR = $(PROJ_DIR)/. \
$(PROJ_DIR)/src \
$(PROJ_DIR)/inc \
# List the user directory to look for the libraries here
ULIBDIR =
# List all user libraries here
ULIBS =
#ULIBS = -lm
# Define optimisation level here
OPT = -O0
#
# End of user defines
##############################################################################################
OBJDIR = .obj
INCDIR = $(patsubst %,-I%,$(DINCDIR) $(UINCDIR))
LIBDIR = $(patsubst %,-L%,$(DLIBDIR) $(ULIBDIR))
DEFS = $(DDEFS) $(UDEFS)
ADEFS = $(DADEFS) $(UADEFS)
OBJS = $(patsubst $(PROJ_DIR)/%, $(PROJ_DIR)/$(OBJDIR)/%, $(ASRC:.s=.o) $(SRC:.c=.o))
LIBS = $(DLIBS) $(ULIBS)
INCDIR += -I"C:\Archivos de programa\CodeSourcery\Sourcery G++ Lite\m68k-elf\include" \
-I"C:\Archivos de programa\CodeSourcery\Sourcery G++ Lite\lib\gcc\m68k-elf\4.4.1\include" \
-I"C:\Archivos de programa\CodeSourcery\Sourcery G++ Lite\lib\gcc\m68k-elf\4.4.1\include-fixed" \
MCFLAGS = -mcpu=528x
#cambiar a 51cn......
ASFLAGS = $(MCFLAGS) -g -Wa,--register-prefix-optional,-amhls=$(@:.o=.lst) $(ADEFS)
CPFLAGS = $(MCFLAGS) $(OPT) -g -fomit-frame-pointer \
-fno-builtin -ffreestanding -nostdinc \
-Wall -Wstrict-prototypes -fverbose-asm \
-Wa,-ahlms=$(@:.o=.lst) $(DEFS)
LDFLAGS = $(MCFLAGS) -T$(LDSCRIPT) \
-fno-builtin -ffreestanding -nostdinc \
-Wl,-Map=$(PROJECT).map,--cref,--no-warn-mismatch $(LIBDIR)
# Generate dependency information
CPFLAGS += -MD -MP -MF .dep/$(@F).d
#
# makefile rules
#
.SECONDEXPANSION:
all: $(OBJS) $(PROJECT).elf $(PROJECT).bin
$(OBJDIR)/%o : %c | $$(@D)/.tmp
$(CC) -c $(CPFLAGS) -I . $(INCDIR) $< -o $@
$(OBJDIR)/%.o : %.s | $$(@D)/.tmp
$(AS) -c $(ASFLAGS) $< -o $@
%elf: $(OBJS)
$(CC) $(OBJS) $(LDFLAGS) $(LIBS) -o $@
%bin: %elf
$(BIN) $< $@
%/.tmp:
-mkdir $(subst /,\,$*)
-touch $@
.PRECIOUS: %/.tmp
version:
echo $(CPFLAGS)
clean:
-del /f/s $(OBJDIR)\*.lst
-del /f/s $(OBJDIR)\*.o
-del /f $(PROJECT).elf
-del /f $(PROJECT).map
-del /f $(PROJECT).bin
-del /f .dep\*.d
#
# Include the dependency files, should be the last of the makefile
#
-include $(shell mkdir .dep 2> nul) $(wildcard .dep/*)
# *** EOF ***
More information about the coldfire-gnu-discuss
mailing list