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.

DS development > Fixing devkitarm's makefile to allow .include and .incbin?

#158776 - Dwedit - Tue Jun 17, 2008 8:58 pm

Posting here because devkitarm's mailing list and message board are both down.

Is it possible to fix the magical devkitarm makefile to get Gnu Assembler to support .include and .incbin correctly?

What methods could be used to go about this?
_________________
"We are merely sprites that dance at the beck and call of our button pressing overlord."

#158802 - josath - Wed Jun 18, 2008 8:19 am

as long as you're using the magical makefile, why not use the magic part that turns binary files into object code for you? then just reference that symbol from within your ASM file.

#158807 - Dwedit - Wed Jun 18, 2008 12:36 pm

That may be a good workaround, and it's the workaround I use, but it still won't bring back .incbin. You lose a few cycles because you can't adr a nearby binary file.
_________________
"We are merely sprites that dance at the beck and call of our button pressing overlord."

#158811 - Cearn - Wed Jun 18, 2008 1:26 pm

During compilation/assembling, the current directory is actually the 'build' directory, not the root of the project. The assembler probably can't find the file there, and because the assembler flags don't contain any include-path information it won't look any further either. To fix, add $(INCLUDE) to ASFLAGS as well.

#158814 - eKid - Wed Jun 18, 2008 1:47 pm

Last time I checked the assembler directives (.include, .incbin) don't use the include options.. :\
#include works though (if using preprocessor).

If you want to be naughty you could do something like...
Code:

.incbin "../bin/foo.bin"

:P

#158817 - Cearn - Wed Jun 18, 2008 4:21 pm

eKid wrote:
Last time I checked the assembler directives (.include, .incbin) don't use the include options.. :\
#include works though (if using preprocessor).
No, they should work. At least it does for the GCC assembler:
gas manual wrote:
Use this option to add a path to the list of directories as searches for files specified in .include directives (see .include). You may use -I as many times as necessary to include a variety of paths. The current working directory is always searched first; after that, as searches any `-I' directories in the same order as they were specified (left to right) on the command line.
Everything goes through -I, same as the compiler.

#158829 - eKid - Thu Jun 19, 2008 12:31 am

Hmm, I just tested and it does work. :P
I guess maybe it was a bug in the previous version.