LD is trying to include the file SFBB.elf as if it were an object file.
The -o signifies the name of the destination file. if you leave -o off I think
it will try and output to a.out
So "-o SFBB.elf" is what you want.
> -----Original Message-----
> From: j_north2002 [mailto:johnny_north@...]
> Sent: Wednesday, 2 October 2002 12:28 PM
> To: gbadev@yahoogroups.com
> Subject: [gbadev] Re: c++ make file
>
>
> At the risk of being overindulgent here... I seem to have gotten rid
> of the undef refs by placing the linker flags at the end of the
> linked files list along w/-o. Now with the following, I get:
>
> /cygdrive/c/GBA/BIN/ld: cannot open SFBB.elf: No such file or
> directory
> NMAKE : fatal error U1077: 'c:\GBA\BIN\ld.exe' : return code '0x1'
>
> I know I must have something incorrect in the linker statement line.
> Any sugestions?
>
> GCCARM = C:GBA\bin
> LIBDIR = C:\GBA\lib\gcc-lib\arm-agb-elf\3.0.2\interwork
> LIBDIR2 = C:\GBA\arm-agb-elf\lib\interwork
> INCDIR = C:\GBA\lib\gcc-lib\arm-agb-elf\3.0.2\include
> INCDIR2 = C:\GBA\arm-agb-elf\include
>
> CFLAGS = -I $(INCDIR2) -I $(INCDIR) -I $(PRJDIR) -mthumb-interwork -
> c -g -O2 -Wall -fverbose-asm
> SFLAGS = -I $(INCDIR2) -I $(INCDIR) -mthumb-interwork
> LDFLAGS = -L $(LIBDIR) -L $(LIBDIR2) -T lnkscript -lg -lc -lgcc
>
> #GFXFILES = all of the .o gfx files
>
> all: SFBB.bin
>
> SFBB.bin: SFBB.elf
> objcopy -O binary SFBB.elf SFBB.bin
>
> SFBB.elf: crt0.o crtbegin.o crtend.o main.o background.o board.o
> console.o piece.o sprite.o $(GFXFILES)
> ld SFBB.elf crt0.o crtbegin.o crtend.o main.o background.o
> board.o console.o piece.o sprite.o $(GFXFILES) -o $(LDFLAGS)
>
> crt0.o: crt0.s
> as $(SFLAGS) -o crt0.s
> main.o: main.cpp
> gcc $(CFLAGS) main.cpp
>
> #I define the compiles of the rest of the cpp compiles from here