Page 1 of 1

Static library makefile

Posted: Mon Feb 21, 2011 1:25 pm
by blueballoon
Hi

I have pulled out some common function that I invariably use in my DS apps and I want to make a static library of these which I will call and link to in future apps. I have a couple of questions about the Makefiles I want to setup:

1. The makefile I and currently using to build this static library tries to build a full DS app. This, of course, fails at link time due to a missing main() etc. How do I change the makefile to compile and then archive the objects (rather than compile and link them)?

2. I always want to build 2 versions of my library that depend upon a pre-processor value (I use a #ifdef in the source). How to I: a) setup the makefile to produce 2 builds of the library, and b) define the pre-processor value that will be seen by the #ifdef in the code at compile time?

My current Makefile looks like this:
ARM7_SELECTED = ARM7_MP3_DSWIFI
BUILD := build
SOURCES := source gfx/bin
INCLUDES := source build gfx
MAKEFILE_VER := ver2
include C:\devkitPro\PAlib\lib\PA_Makefile

Thanks.

Re: Static library makefile

Posted: Mon Feb 21, 2011 1:43 pm
by WinterMute
We don't support PAlib users, sorry.

http://devkitpro.org/wiki/PAlib

Re: Static library makefile

Posted: Mon Feb 21, 2011 2:44 pm
by blueballoon
The static library I am trying to create does not use PALib. The reference in the current makefile to PALib is just because that was the makefile I happened to choose when I attempted to create a library.

I would be grateful for some help with my makefile issues (I appreciate the current makefile was not a good choose).
Thanks

Re: Static library makefile

Posted: Tue Feb 22, 2011 12:01 pm
by WinterMute
Then I strongly suggest you remove PAlib from your install completely. Ideally delete the whole devkitPro folder and reinstall from scratch - unfortunately we've found that PAlib users tend to have all sorts of inappropriate things in their installs which interfere with the correct functioning of the toolchain.

devkitPro provide a template for an arm9 library found in the template folder of the examples, named arm9lib.