gbadev.org forum archive

This is a read-only mirror of the content originally found on forum.gbadev.org (now offline), salvaged from Wayback machine copies. A new forum can be found here.

Coding > Makefile?

#28498 - wiz - Mon Nov 01, 2004 7:42 pm

Hi guys,

For some reason my make file seems to be running too fast (?!)

Here is the contents of a test,

Code:

CFLAGS = -c -O2

all: myRom.gba

myRom.gba: myRom.elf
   objcopy -O binary myRom.elf myRom.gba

myRom.elf: main.o
   $(CC) -o myRom.elf main.o

main.o: main.c
   $(CC) $(CFLAGS) main.o main.c


This results in:

gcc -c -O2 main.o main.c
gcc: main.o: No such file or directory
make: *** [main.o] Error 1

But if I run it again (once main.o exists) - it works? Its as though there is not enough time for main.o to be created, does that make sense?

Any idea on this bizzare problem?

Many Thanks!!!

#28500 - sajiimori - Mon Nov 01, 2004 7:56 pm

It thinks main.o is an input file. You need to put -o before it to say it's the output file, like you did with the .elf.

#28501 - wiz - Mon Nov 01, 2004 8:01 pm

wow that was a very fast reply, and now I feel really stupid for asking it :(

works now cheers sajiimori!!


:)

[edit] PS if you think that was a bad mistake, I called the batch file to run make as "make.bat" ... guess what happened? ;p How embarrasing maybe I should just give in for the day