Hello *,
I'm 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 compile:
***multiple target patterns. Stop.
Here is the code of the makefile and the line where the error comes:
########################################################################
######################
# Start of user section
#
# Define project name here
PROJECT = helloFirst
PROJ_DIR = "D:/Tools/HelloFirst"
# Define linker script file here
LDSCRIPT = "C:/Program Files/CodeSourcery/Sourcery
G++/m68k-elf/lib/m5475/m5485evb-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 = "C:/cygwin/lib"
# List all user libraries here
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:/Program Files/CodeSourcery/Sourcery G++
Lite/lib/gcc/m68k-elf/4.2.3/include" \
-I"C:/Program Files/CodeSourcery/Sourcery G++
Lite/m68k-elf/include" \
-I"C:/Program Files/CodeSourcery/Sourcery G++
Lite/m68k-elf/include/sys" \
-I"C:/Program Files/CodeSourcery/Sourcery G++
Lite/m68k-elf/include/machine" \
-I"C:/Program Files/CodeSourcery/Sourcery G++
Lite/lib/gcc/m68k-elf/4.2.3/install-tools/include"
MCFLAGS = -mcpu=548x
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 # ß------Error comes
here-------<
$(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
Please, can some one help me with this topic? I don’t have any
experience with makefile, I looked already the documentation on the GNU
website and many forums but couldn’t find any solution.
Many thanks in advance
Pablo