Page 1 of 1

NDS static library not compiling

Posted: Tue Feb 07, 2012 1:24 am
by halofreak1990
When I try to compile a static library, the makefile refuses to pick up any file other than the template .cpp file.
When I tried removing the template.cpp file, since I'd already written other .cpp file, and tried a recompile, it produced an empty .a library.

I haven't modified the Makefile, so what could be wrong here?

As a side note, I'm using VS2010, and I can compile NDS binaries, so the toolchain works as it should.
Could it be because I have both a NDS game and an NDS static library project in the same Solution?

Re: NDS static library not compiling

Posted: Sun Feb 19, 2012 1:31 pm
by halofreak1990
Ok, I figured out the problem; I made subdirectories in the /source folder of my library project, which contained my .cpp files.
the devkitPro Makefiles do not pick up source files from subdirectories.
Moving the files back into the root of the /source directory fixed it.

I feel so stupid... I've been working with OpenXDK for several years, which also uses a GNU toolchain, and that, too, doesn't search subdirectories for source files.

Re: NDS static library not compiling

Posted: Tue Feb 21, 2012 2:50 pm
by WinterMute
Actually it is possible to get the Makefiles to pick up files in subdirectories of the source folder, we just didn't automate this process because it can cause some issues for people who don't expect it to happen.

add your subdirectories to the SOURCES variable in the Makefile, noting that all paths are relative to the Makefile, for instance :-

Code: Select all

SOURCES		:=	source source/subdir1 source/subdir2